diff --git a/process/drivers/cosign_driver.rs b/process/drivers/cosign_driver.rs index a837e0ed..0460d4b1 100644 --- a/process/drivers/cosign_driver.rs +++ b/process/drivers/cosign_driver.rs @@ -25,15 +25,14 @@ impl SigningDriver for CosignDriver { let path = opts.dir.as_ref().map_or_else(|| Path::new("."), |dir| dir); let mut command = cmd!( + cd path; + env { + COSIGN_PASSWORD: "", + COSIGN_YES: "true", + }; "cosign", "generate-key-pair", - // COSIGN_PASSWORD => "", - // COSIGN_YES => "true", ); - command - .current_dir(path) - .env(COSIGN_PASSWORD, "") - .env(COSIGN_YES, "true"); let status = command.status().into_diagnostic()?; @@ -49,13 +48,14 @@ impl SigningDriver for CosignDriver { let priv_key = get_private_key(path)?; let mut command = cmd!( + env { + COSIGN_PASSWORD: "", + COSIGN_YES: "true" + }; "cosign", "public-key", format!("--key={priv_key}"), - // COSIGN_PASSWORD => "", - // COSIGN_YES => "true", ); - command.env(COSIGN_PASSWORD, "").env(COSIGN_YES, "true"); trace!("{command:?}"); let output = command.output().into_diagnostic()?; diff --git a/src/commands/init.rs b/src/commands/init.rs index 1312780e..16903312 100644 --- a/src/commands/init.rs +++ b/src/commands/init.rs @@ -314,8 +314,7 @@ impl InitCommand { let dir = self.dir.as_ref().unwrap(); - let mut command = cmd!("git", "commit", "-a", "-m", "chore: Initial Commit"); - command.current_dir(dir); + let mut command = cmd!(cd dir; "git", "commit", "-a", "-m", "chore: Initial Commit"); trace!("{command:?}"); let status = command @@ -337,8 +336,7 @@ impl InitCommand { let dir = self.dir.as_ref().unwrap(); - let mut command = cmd!("git", "add", "."); - command.current_dir(dir); + let mut command = cmd!(cd dir; "git", "add", "."); trace!("{command:?}"); let status = command