Skip to content

Commit

Permalink
Update path var
Browse files Browse the repository at this point in the history
  • Loading branch information
vcfxb committed Mar 20, 2024
1 parent c201f5c commit 623d8ba
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions ci/src/bin/install-llvm-windows.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Script that gets called by CI to install LLVM on windows.
use std::{fs, io, time::Duration};
use std::{env, fs, io, path::PathBuf, time::Duration};

use indicatif::{HumanBytes, ProgressBar};
use tar::Archive;
Expand Down Expand Up @@ -64,7 +64,13 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {

println!("Renamining {rename_folder} to {dest_dir}");

fs::rename(rename_folder, dest_dir)?;
fs::rename(rename_folder, &dest_dir)?;

// Append the install to path.
println!("Updating PATH var");
let current_path_var = env::var("PATH")?;
let fq_install_dir = PathBuf::from(dest_dir).canonicalize()?.join("bin");
env::set_var("PATH", format!("{};{}", current_path_var, fq_install_dir.display()));

Ok(())
}

0 comments on commit 623d8ba

Please sign in to comment.