refactor(cli): sweep 15 bail("git X") sites to use git_run with context labels
This commit is contained in:
@@ -90,16 +90,16 @@ pub fn cmd_init(image: PathBuf, output: PathBuf) -> Result<()> {
|
||||
fs::write(root.join(".gitignore"), gitignore)?;
|
||||
|
||||
// git init + initial commit via hardened wrapper.
|
||||
let status = crate::helpers::git_command(&root, &["init"]).status()?;
|
||||
if !status.success() { anyhow::bail!("git init failed"); }
|
||||
crate::helpers::git_run(&root, &["init"], "init: git init")?;
|
||||
let _ = crate::helpers::git_command(&root, &[
|
||||
"add", ".gitignore", ".relicario/params.json",
|
||||
".relicario/salt", "manifest.enc", "settings.enc",
|
||||
]).status()?;
|
||||
let status = crate::helpers::git_command(&root, &[
|
||||
"commit", "-m", "init: new Relicario vault (format v2)",
|
||||
]).status()?;
|
||||
if !status.success() { anyhow::bail!("git commit failed"); }
|
||||
crate::helpers::git_run(
|
||||
&root,
|
||||
&["commit", "-m", "init: new Relicario vault (format v2)"],
|
||||
"init: git commit",
|
||||
)?;
|
||||
|
||||
eprintln!("Vault initialized at {}", root.display());
|
||||
eprintln!("Reference image: {}", output.display());
|
||||
|
||||
Reference in New Issue
Block a user