Use sudo and don't try to prompt on no-confirm

This commit is contained in:
Ana Hobden 2022-11-08 12:21:02 -08:00
parent d900830f04
commit 47ae6398f8
2 changed files with 8 additions and 6 deletions

View file

@ -135,13 +135,13 @@ jobs:
with: with:
name: harmonic-x86_64-darwin name: harmonic-x86_64-darwin
- name: Initial install - name: Initial install
run: ./harmonic install darwin-multi --no-confirm run: sudo ./harmonic install darwin-multi --no-confirm
- name: Test run - name: Test run
run: nix run nixpkgs#fortune run: nix run nixpkgs#fortune
- name: Initial uninstall - name: Initial uninstall
run: ./harmonic uninstall --no-confirm run: sudo ./harmonic uninstall --no-confirm
- name: Repeated install - name: Repeated install
run: ./harmonic install darwin-multi --no-confirm run: sudo ./harmonic install darwin-multi --no-confirm
- name: Repeated uninstall - name: Repeated uninstall
run: ./harmonic uninstall --no-confirm run: sudo ./harmonic uninstall --no-confirm

View file

@ -61,8 +61,10 @@ impl CommandExecute for Install {
if let Err(err) = plan.install().await { if let Err(err) = plan.install().await {
tracing::error!("{:?}", eyre!(err)); tracing::error!("{:?}", eyre!(err));
if !interaction::confirm(plan.describe_revert(explain)).await? { if !no_confirm {
interaction::clean_exit_with_message("Okay, didn't do anything! Bye!").await; if !interaction::confirm(plan.describe_revert(explain)).await? {
interaction::clean_exit_with_message("Okay, didn't do anything! Bye!").await;
}
} }
plan.revert().await? plan.revert().await?
} }