Skip to content

Commit

Permalink
Plan prompts for sudo (#639)
Browse files Browse the repository at this point in the history
* Plan prompts for sudo

* clippy/fmt
  • Loading branch information
Hoverbear authored Sep 22, 2023
1 parent 8911329 commit 1da69ee
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/cli/subcommand/plan.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::{path::PathBuf, process::ExitCode};

use crate::{error::HasExpectedErrors, BuiltinPlanner};
use crate::{cli::ensure_root, error::HasExpectedErrors, BuiltinPlanner};
use clap::Parser;

use eyre::WrapErr;
Expand Down Expand Up @@ -32,6 +32,8 @@ impl CommandExecute for Plan {
async fn execute(self) -> eyre::Result<ExitCode> {
let Self { planner, output } = self;

ensure_root()?;

let planner = match planner {
Some(planner) => planner,
None => BuiltinPlanner::default().await?,
Expand Down

0 comments on commit 1da69ee

Please sign in to comment.