Skip to content

Commit 479cbca

Browse files
committed
utils: Use run helper for editor
I just happened to glance at this code, this gives us stderr in the error, etc. Signed-off-by: Colin Walters <[email protected]>
1 parent af207a0 commit 479cbca

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

lib/src/utils.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -117,16 +117,12 @@ pub(crate) fn spawn_editor(tmpf: &tempfile::NamedTempFile) -> Result<()> {
117117
let argv0 = editor_args
118118
.next()
119119
.ok_or_else(|| anyhow::anyhow!("Invalid editor: {editor}"))?;
120-
let status = Command::new(argv0)
120+
Command::new(argv0)
121121
.args(editor_args)
122122
.arg(tmpf.path())
123123
.lifecycle_bind()
124-
.status()
125-
.context("Spawning editor")?;
126-
if !status.success() {
127-
anyhow::bail!("Invoking editor: {editor} failed: {status:?}");
128-
}
129-
Ok(())
124+
.run()
125+
.with_context(|| format!("Invoking editor {editor} failed"))
130126
}
131127

132128
/// Convert a combination of values (likely from CLI parsing) into a signature source

0 commit comments

Comments
 (0)