From 187452b31a0aa411670507c5bb28ff4d80856fd4 Mon Sep 17 00:00:00 2001 From: Roey Darwish Dror Date: Sat, 25 May 2019 21:28:16 +0300 Subject: [PATCH] Fix missing check that the Powershell profile actually exists (fix #157) --- src/steps/os/windows.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/steps/os/windows.rs b/src/steps/os/windows.rs index c9115ee3..266b44e8 100644 --- a/src/steps/os/windows.rs +++ b/src/steps/os/windows.rs @@ -1,7 +1,7 @@ use crate::error::{Error, ErrorKind}; use crate::executor::{CommandExt, RunType}; use crate::terminal::{is_dumb, print_separator}; -use crate::utils::{require, require_option, which}; +use crate::utils::{require, require_option, which, PathExt}; use std::path::PathBuf; use std::process::Command; @@ -39,6 +39,7 @@ impl Powershell { .args(&["-Command", "echo $profile"]) .check_output() .map(|output| PathBuf::from(output.trim())) + .and_then(|p| p.require()) .ok() });