mirror of
https://github.com/mmvanheusden/SteamDepotDownloaderGUI.git
synced 2026-02-04 05:31:19 +01:00
fix: macOS
This commit is contained in:
@@ -44,6 +44,8 @@ async fn start_download(steam_download: steam::SteamDownload, app: AppHandle) {
|
||||
let default_terminal = TERMINAL.get().unwrap();
|
||||
let shell = app.shell();
|
||||
let terminal_to_use = if steam_download.options().terminal().is_none() { default_terminal.first().unwrap() } else { &Terminal::from_index(&steam_download.options().terminal().unwrap()).unwrap() };
|
||||
// Also change working directory
|
||||
std::env::set_current_dir(&WORKING_DIR.get().unwrap()).unwrap();
|
||||
|
||||
println!("\n-------------------------DEBUG INFO------------------------");
|
||||
println!("received these values from frontend:");
|
||||
@@ -139,4 +141,4 @@ fn main() {
|
||||
preload_vectum,
|
||||
get_all_terminals
|
||||
]).run(tauri::generate_context!()).expect("error while running tauri application");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -206,16 +206,13 @@ impl Terminal {
|
||||
}
|
||||
Terminal::Terminal => {
|
||||
// Create a bash script and run that. Not very secure but it makes this easier.
|
||||
let download_script = format!("#!/bin/bash\ncd {}\n{}",working_dir.as_path().display(), command[0]);
|
||||
// println!("{}", download_script);
|
||||
let download_script = format!("#!/bin/bash\ncd {}\n{}",working_dir.to_str().unwrap().replace(" ", "\\ "), command[0]);
|
||||
|
||||
fs::write("./script.sh", download_script).unwrap();
|
||||
|
||||
#[cfg(unix)]
|
||||
{
|
||||
//todo: test if still working
|
||||
use std::os::unix::fs::PermissionsExt;
|
||||
|
||||
fs::set_permissions("./script.sh", fs::Permissions::from_mode(0o755)).unwrap(); // Won't run without executable permission
|
||||
}
|
||||
|
||||
@@ -309,4 +306,4 @@ fn create_depotdownloader_command(steam_download: &SteamDownload) -> Vec<String>
|
||||
vec![format!(r#".\DepotDownloader.exe -username {} -password {} -app {} -depot {} -manifest {} -dir {}"#, steam_download.username().clone().unwrap(), steam_download.password().clone().unwrap(), steam_download.app_id(), steam_download.depot_id(), steam_download.manifest_id(), output_dir)]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user