From da25634c18320880fa1aed440e8675cc58498684 Mon Sep 17 00:00:00 2001 From: Roey Darwish Dror Date: Wed, 27 Feb 2019 09:47:20 +0200 Subject: [PATCH] Add a flag for disabling Powershell --- src/config.rs | 3 +++ src/main.rs | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/config.rs b/src/config.rs index 7a393f99..bbfd137d 100644 --- a/src/config.rs +++ b/src/config.rs @@ -23,6 +23,9 @@ lazy_static! { m.insert("emacs", Step::Emacs); m.insert("gem", Step::Gem); + #[cfg(windows)] + m.insert("powershell", Step::Powershell); + m }; } diff --git a/src/main.rs b/src/main.rs index 2d13cc1c..8fc54e28 100644 --- a/src/main.rs +++ b/src/main.rs @@ -131,9 +131,12 @@ fn run() -> Result<(), Error> { #[cfg(windows)] let powershell = windows::Powershell::new(); + #[cfg(windows)] + let should_run_powershell = powershell.profile().is_some() && config.should_run(Step::Powershell); + #[cfg(windows)] { - if powershell.profile().is_some() && config.should_run(Step::Powershell) { + if should_run_powershell { execute( &mut report, "Powershell Modules Update",