Fix: fix rust script invocation as load_script #1035

This commit is contained in:
sagie gur ari
2024-02-02 10:06:23 +00:00
parent 94b041915d
commit 1a550265bb
3 changed files with 18 additions and 1 deletions
+4
View File
@@ -1,5 +1,9 @@
## CHANGELOG
### v0.37.9
* Fix: fix rust script invocation as load_script #1035
### v0.37.8 (2024-01-24)
* Enhancement: Support script runners and shebang in condition scripts #987
+9
View File
@@ -1,4 +1,13 @@
[config]
load_script = """
#!@rust
fn main() {
println!("test load script invocation via rust");
}
"""
[tasks.rust]
script_runner = "@rust"
script = '''
+5 -1
View File
@@ -27,7 +27,11 @@ pub(crate) fn create_persisted_script_file(script_text: &Vec<String>, extension:
let bytes = Sha256::digest(string_bytes);
let file_name = bytes_to_hex(&bytes[..]);
let directory = envmnt::get_or_panic("CARGO_MAKE_CRATE_CUSTOM_TRIPLE_TARGET_DIRECTORY");
let default_target_directory = envmnt::get_or("CARGO_MAKE_CRATE_TARGET_DIRECTORY", "target");
let directory = envmnt::get_or(
"CARGO_MAKE_CRATE_CUSTOM_TRIPLE_TARGET_DIRECTORY",
&default_target_directory,
);
let mut file_path_buf = PathBuf::new();
file_path_buf.push(&directory);
file_path_buf.push("_cargo_make_temp");