Skip to content

Commit

Permalink
fix reference on rustup
Browse files Browse the repository at this point in the history
  • Loading branch information
georgik committed Aug 11, 2023
1 parent c42d7f7 commit d00bc04
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src-tauri/src/rust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,10 @@ pub async fn install_rustup(window: Window, app: tauri::AppHandle, selected_vari
let fname = "rustup-init.sh";

let output_dir = dirs::home_dir().ok_or("Failed to get home directory")?.join(".cargo").join("bin");
let rustup_path = output_dir.join(fname);
let rustup_path = output_dir.join(fname).to_str().unwrap().to_string();

// Check if rustup is already installed
match Command::new(rustup_path).arg("--version").output() {
match Command::new(rustup_path.clone()).arg("--version").output() {
Ok(output) => {
if output.status.success() {
info!("Rustup already installed");
Expand All @@ -163,13 +163,13 @@ pub async fn install_rustup(window: Window, app: tauri::AppHandle, selected_vari
args.push(variant);
}

run_external_command_with_progress(window.clone(), app, rustup_path, &args, "PROGRESS_EVENT").await;
run_external_command_with_progress(window.clone(), app, &rustup_path, &args, "PROGRESS_EVENT").await;
}

#[cfg(unix)]
{
let args = vec!["-y"];
run_external_command_with_progress(window.clone(), app,rustup_path, &args, "PROGRESS_EVENT").await;
run_external_command_with_progress(window.clone(), app, &rustup_path, &args, "PROGRESS_EVENT").await;
}

info!("Rustup installed or already present");
Expand Down

0 comments on commit d00bc04

Please sign in to comment.