Set PATH when running yay (fix #192)

Instead of causing an error when the Python in path is not the system Python, we prepend /usr/bin to
PATH and then run yay.
This commit is contained in:
Roey Darwish Dror
2019-08-15 09:15:35 +03:00
parent d552360ab6
commit 69dfcfe55a
3 changed files with 35 additions and 34 deletions

View File

@@ -101,6 +101,23 @@ impl Executor {
self
}
#[allow(dead_code)]
/// See `std::process::Command::env`
pub fn env<K, V>(&mut self, key: K, val: V) -> &mut Executor
where
K: AsRef<OsStr>,
V: AsRef<OsStr>,
{
match self {
Executor::Wet(c) => {
c.env(key, val);
}
Executor::Dry(_) => (),
}
self
}
/// See `std::process::Command::spawn`
pub fn spawn(&mut self) -> Result<ExecutorChild, Error> {
let result = match self {