Skip to content

Commit

Permalink
Prefer -C instead of cd when untar-ing
Browse files Browse the repository at this point in the history
  • Loading branch information
schneems committed Jul 5, 2024
1 parent aa44be3 commit aa7f478
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions shared/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,11 @@ pub fn untar_to_dir(tar_path: &TarDownloadPath, workspace: &Path) -> Result<(),
// Shelling out due to https://github.com/alexcrichton/tar-rs/issues/369
let mut cmd = Command::new("bash");
cmd.arg("-c");
cmd.arg(
[
format!("cd {}", workspace.display()),
format!("tar xzf {}", tar_path.as_ref().display()),
]
.join(" && "),
);
cmd.arg(format!(
"tar xzf {tar_file} -C {out_dir}",
tar_file = tar_path.as_ref().display(),
out_dir = workspace.display()
));
cmd.named_output().map_err(Error::CmdError)?;

Ok(())
Expand Down

0 comments on commit aa7f478

Please sign in to comment.