From 1da69eef4a3147c7b95a81c8a67b5cdd2f1ab4f2 Mon Sep 17 00:00:00 2001 From: Ana Hobden Date: Fri, 22 Sep 2023 11:08:01 -0700 Subject: [PATCH] Plan prompts for sudo (#639) * Plan prompts for sudo * clippy/fmt --- src/cli/subcommand/plan.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cli/subcommand/plan.rs b/src/cli/subcommand/plan.rs index 923261094..a97fcdf54 100644 --- a/src/cli/subcommand/plan.rs +++ b/src/cli/subcommand/plan.rs @@ -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; @@ -32,6 +32,8 @@ impl CommandExecute for Plan { async fn execute(self) -> eyre::Result { let Self { planner, output } = self; + ensure_root()?; + let planner = match planner { Some(planner) => planner, None => BuiltinPlanner::default().await?,