mirror of
https://github.com/esp-rs/espup.git
synced 2025-09-27 12:50:54 +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)]
|
||||
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(
|
||||
"PATH",
|
||||
std::env::var("PATH").unwrap() + ";" + &self.get_bin_path().replace('/', "\\"),
|
||||
self.get_bin_path().replace('/', "\\") + ";" + &std::env::var("PATH").unwrap(),
|
||||
);
|
||||
}
|
||||
#[cfg(unix)]
|
||||
|
@ -153,7 +153,10 @@ impl Installable for Llvm {
|
||||
"$Env:LIBCLANG_PATH = \"{}/libclang.dll\"",
|
||||
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")
|
||||
.args([
|
||||
"LIBCLANG_PATH",
|
||||
@ -164,7 +167,7 @@ impl Installable for Llvm {
|
||||
.output()?;
|
||||
std::env::set_var(
|
||||
"PATH",
|
||||
std::env::var("PATH").unwrap() + ";" + &self.get_lib_path().replace('/', "\\"),
|
||||
self.get_lib_path().replace('/', "\\") + ";" + &std::env::var("PATH").unwrap(),
|
||||
);
|
||||
}
|
||||
#[cfg(unix)]
|
||||
|
Loading…
x
Reference in New Issue
Block a user