MCPcopy Create free account
hub / github.com/delinoio/oss / write_test_executable

Function write_test_executable

crates/nodeup/src/command_plan.rs:807–819  ·  view source on GitHub ↗
(path: impl AsRef<Path>, content: &str)

Source from the content-addressed store, hash-verified

805 }
806
807 fn write_test_executable(path: impl AsRef<Path>, content: &str) {
808 let path = path.as_ref();
809 fs::write(path, content).expect("write test executable");
810
811 #[cfg(unix)]
812 {
813 let mut permissions = fs::metadata(path)
814 .expect("test executable metadata")
815 .permissions();
816 permissions.set_mode(0o755);
817 fs::set_permissions(path, permissions).expect("set test executable permissions");
818 }
819 }
820
821 #[test]
822 fn yarn_major_one_maps_to_yarn_package_spec() {

Calls 3

writeFunction · 0.50
metadataFunction · 0.50
as_refMethod · 0.45