Fix missing check that the Powershell profile actually exists (fix #157)
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
use crate::error::{Error, ErrorKind};
|
use crate::error::{Error, ErrorKind};
|
||||||
use crate::executor::{CommandExt, RunType};
|
use crate::executor::{CommandExt, RunType};
|
||||||
use crate::terminal::{is_dumb, print_separator};
|
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::path::PathBuf;
|
||||||
use std::process::Command;
|
use std::process::Command;
|
||||||
|
|
||||||
@@ -39,6 +39,7 @@ impl Powershell {
|
|||||||
.args(&["-Command", "echo $profile"])
|
.args(&["-Command", "echo $profile"])
|
||||||
.check_output()
|
.check_output()
|
||||||
.map(|output| PathBuf::from(output.trim()))
|
.map(|output| PathBuf::from(output.trim()))
|
||||||
|
.and_then(|p| p.require())
|
||||||
.ok()
|
.ok()
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user