fix: use std::env::var to fetch CARGO_TARGET_DIR at compile time

pull/110/head
gamedolphin 6 months ago
parent b55766232b
commit 44e7550347

@ -32,8 +32,8 @@ pub fn run(opts: Options) -> Result<(), anyhow::Error> {
// profile we are building (release or debug) // profile we are building (release or debug)
let profile = if opts.release { "release" } else { "debug" }; let profile = if opts.release { "release" } else { "debug" };
let target_dir = std::env!("CARGO_TARGET_DIR"); let target_path = std::env::var("CARGO_TARGET_DIR").unwrap_or("target".into());
let bin_path = format!("{target_dir}/{profile}/{{project-name}}"); let bin_path = format!("{target_path}/{profile}/{{project-name}}");
// arguments to pass to the application // arguments to pass to the application
let mut run_args: Vec<_> = opts.run_args.iter().map(String::as_str).collect(); let mut run_args: Vec<_> = opts.run_args.iter().map(String::as_str).collect();

Loading…
Cancel
Save