mirror of
https://github.com/esp-rs/espup.git
synced 2025-10-02 15:14:56 +00:00
Prepend PATH (#202)
* refactor: ♻️ Prepend variables in PATH * fix: 🐛 Fix Windows compilation
This commit is contained in:
parent
2a97a811f2
commit
2b4eb00bd1
@ -115,10 +115,13 @@ impl Installable for Gcc {
|
|||||||
|
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
if cfg!(windows) {
|
if cfg!(windows) {
|
||||||
exports.push(format!("$Env:PATH += \";{}\"", &self.get_bin_path()));
|
exports.push(format!(
|
||||||
|
"$Env:PATH = \"{};\" + $Env:PATH",
|
||||||
|
&self.get_bin_path()
|
||||||
|
));
|
||||||
std::env::set_var(
|
std::env::set_var(
|
||||||
"PATH",
|
"PATH",
|
||||||
std::env::var("PATH").unwrap() + ";" + &self.get_bin_path().replace('/', "\\"),
|
self.get_bin_path().replace('/', "\\") + ";" + &std::env::var("PATH").unwrap(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
|
@ -153,7 +153,10 @@ impl Installable for Llvm {
|
|||||||
"$Env:LIBCLANG_PATH = \"{}/libclang.dll\"",
|
"$Env:LIBCLANG_PATH = \"{}/libclang.dll\"",
|
||||||
self.get_lib_path()
|
self.get_lib_path()
|
||||||
));
|
));
|
||||||
exports.push(format!("$Env:PATH += \";{}\"", self.get_lib_path()));
|
exports.push(format!(
|
||||||
|
"$Env:PATH = \"{};\" + $Env:PATH",
|
||||||
|
self.get_lib_path()
|
||||||
|
));
|
||||||
Command::new("setx")
|
Command::new("setx")
|
||||||
.args([
|
.args([
|
||||||
"LIBCLANG_PATH",
|
"LIBCLANG_PATH",
|
||||||
@ -164,7 +167,7 @@ impl Installable for Llvm {
|
|||||||
.output()?;
|
.output()?;
|
||||||
std::env::set_var(
|
std::env::set_var(
|
||||||
"PATH",
|
"PATH",
|
||||||
std::env::var("PATH").unwrap() + ";" + &self.get_lib_path().replace('/', "\\"),
|
self.get_lib_path().replace('/', "\\") + ";" + &std::env::var("PATH").unwrap(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user