Skip to content

Commit a92a214

Browse files
chore: fix merge
1 parent 1ca3d68 commit a92a214

File tree

1 file changed

+24
-25
lines changed

1 file changed

+24
-25
lines changed

src/gpg.rs

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ pub fn gen_key(
124124
email: &str,
125125
) -> Result<(), WorkerError> {
126126
let command_args = [
127+
"--debug-level",
128+
gpg_debug_level,
127129
"--homedir",
128130
gpg_home,
129131
"--batch",
@@ -137,16 +139,7 @@ pub fn gen_key(
137139
command_args.join(" ")
138140
);
139141
let mut child = Command::new(gpg_command)
140-
.args([
141-
"--debug-level",
142-
gpg_debug_level,
143-
"--homedir",
144-
gpg_home,
145-
"--batch",
146-
"--command-fd",
147-
"0",
148-
"--full-gen-key",
149-
])
142+
.args(command_args)
150143
.stdin(Stdio::piped())
151144
.spawn()?;
152145
let mut stdin = child.stdin.take().ok_or(WorkerError::Gpg)?;
@@ -164,22 +157,28 @@ pub fn key_to_card(
164157
gpg_home: &str,
165158
email: &str,
166159
) -> Result<(), WorkerError> {
160+
let command_args = [
161+
"--debug-level",
162+
gpg_debug_level,
163+
"--homedir",
164+
gpg_home,
165+
"--command-fd=0",
166+
"--status-fd=1",
167+
"--passphrase-fd=0",
168+
"--batch",
169+
"--yes",
170+
"--pinentry-mode=loopback",
171+
"--edit-key",
172+
"--no-tty",
173+
email,
174+
];
175+
debug!(
176+
"Transferring keys via {} with args: {}",
177+
gpg_command,
178+
&command_args.join(" ")
179+
);
167180
let mut child = Command::new(gpg_command)
168-
.args([
169-
"--debug-level",
170-
gpg_debug_level,
171-
"--homedir",
172-
gpg_home,
173-
"--command-fd=0",
174-
"--status-fd=1",
175-
"--passphrase-fd=0",
176-
"--batch",
177-
"--yes",
178-
"--pinentry-mode=loopback",
179-
"--edit-key",
180-
"--no-tty",
181-
email,
182-
])
181+
.args(command_args)
183182
.env("LANG", "en")
184183
.stdin(Stdio::piped())
185184
.spawn()?;

0 commit comments

Comments
 (0)