Fix missing check that the Powershell profile actually exists (fix #157)

This commit is contained in:
Roey Darwish Dror
2019-05-25 21:28:16 +03:00
parent 90c3420743
commit 187452b31a

View File

@@ -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()
});