Merge pull request #111 from esp-rs/fix/windows-exports

Fix Windows exports
This commit is contained in:
Sergio Gasquez Arcos 2022-12-23 14:20:25 +01:00 committed by GitHub
commit 299494e913
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -466,6 +466,8 @@ fn export_environment(export_file: &PathBuf, exports: &[String]) -> Result<(), E
info!("{} Creating export file", emoji::WRENCH); info!("{} Creating export file", emoji::WRENCH);
let mut file = File::create(export_file)?; let mut file = File::create(export_file)?;
for e in exports.iter() { for e in exports.iter() {
#[cfg(windows)]
let e = e.replace('/', r#"\"#);
file.write_all(e.as_bytes())?; file.write_all(e.as_bytes())?;
file.write_all(b"\n")?; file.write_all(b"\n")?;
} }

View File

@ -90,7 +90,7 @@ impl Installable for Gcc {
#[cfg(windows)] #[cfg(windows)]
exports.push(format!("$Env:PATH += \";{}\"", &self.get_bin_path())); exports.push(format!("$Env:PATH += \";{}\"", &self.get_bin_path()));
#[cfg(unix)] #[cfg(unix)]
exports.push(format!("export PATH={}:$PATH", &self.get_bin_path())); exports.push(format!("export PATH=\"{}:$PATH\"", &self.get_bin_path()));
Ok(exports) Ok(exports)
} }