Skip to content

Commit

Permalink
chore: fix merge
Browse files Browse the repository at this point in the history
  • Loading branch information
filipslezaklab committed Oct 16, 2023
1 parent 1ca3d68 commit a92a214
Showing 1 changed file with 24 additions and 25 deletions.
49 changes: 24 additions & 25 deletions src/gpg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ pub fn gen_key(
email: &str,
) -> Result<(), WorkerError> {
let command_args = [
"--debug-level",
gpg_debug_level,
"--homedir",
gpg_home,
"--batch",
Expand All @@ -137,16 +139,7 @@ pub fn gen_key(
command_args.join(" ")
);
let mut child = Command::new(gpg_command)
.args([
"--debug-level",
gpg_debug_level,
"--homedir",
gpg_home,
"--batch",
"--command-fd",
"0",
"--full-gen-key",
])
.args(command_args)
.stdin(Stdio::piped())
.spawn()?;
let mut stdin = child.stdin.take().ok_or(WorkerError::Gpg)?;
Expand All @@ -164,22 +157,28 @@ pub fn key_to_card(
gpg_home: &str,
email: &str,
) -> Result<(), WorkerError> {
let command_args = [
"--debug-level",
gpg_debug_level,
"--homedir",
gpg_home,
"--command-fd=0",
"--status-fd=1",
"--passphrase-fd=0",
"--batch",
"--yes",
"--pinentry-mode=loopback",
"--edit-key",
"--no-tty",
email,
];
debug!(
"Transferring keys via {} with args: {}",
gpg_command,
&command_args.join(" ")
);
let mut child = Command::new(gpg_command)
.args([
"--debug-level",
gpg_debug_level,
"--homedir",
gpg_home,
"--command-fd=0",
"--status-fd=1",
"--passphrase-fd=0",
"--batch",
"--yes",
"--pinentry-mode=loopback",
"--edit-key",
"--no-tty",
email,
])
.args(command_args)
.env("LANG", "en")
.stdin(Stdio::piped())
.spawn()?;
Expand Down

0 comments on commit a92a214

Please sign in to comment.