Skip to content

Commit

Permalink
chore: Use new comlexr features
Browse files Browse the repository at this point in the history
  • Loading branch information
gmpinder committed Jan 29, 2025
1 parent 9ce18a2 commit b41ba22
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
18 changes: 9 additions & 9 deletions process/drivers/cosign_driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()?;

Expand All @@ -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()?;
Expand Down
6 changes: 2 additions & 4 deletions src/commands/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit b41ba22

Please sign in to comment.