Skip to content

Commit

Permalink
args -> expanded_args
Browse files Browse the repository at this point in the history
To facilitate next commit.
  • Loading branch information
smoelius committed Apr 5, 2024
1 parent b94e3ac commit 2439151
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/util/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,15 @@ fn unpack_and_exec(bytes: &[u8]) -> Result<()> {
let cmd =
option_env!("BUILD_WRAP_CMD").ok_or_else(|| anyhow!("`BUILD_WRAP_CMD` is undefined"))?;
let expanded_cmd = __expand_cmd(cmd, &temp_path)?;
let args = expanded_cmd.split_ascii_whitespace().collect::<Vec<_>>();
eprintln!("expanded `BUILD_WRAP_CMD`: {:#?}", &args);
let expanded_args = expanded_cmd.split_ascii_whitespace().collect::<Vec<_>>();
eprintln!("expanded `BUILD_WRAP_CMD`: {:#?}", &expanded_args);
ensure!(
!args.is_empty(),
!expanded_args.is_empty(),
"expanded `BUILD_WRAP_CMD` is empty or all whitespace"
);

let mut command = Command::new(args[0]);
command.args(&args[1..]);
let mut command = Command::new(expanded_args[0]);
command.args(&expanded_args[1..]);
let _: Output = exec(command, true)?;

drop(temp_path);
Expand Down

0 comments on commit 2439151

Please sign in to comment.