From 7b7150886a6b2c3683f8d32909b6337ec9c6e238 Mon Sep 17 00:00:00 2001 From: Gregory Ballantine Date: Mon, 22 Aug 2022 13:47:49 -0400 Subject: [PATCH] Made the Steam game download function work for both Windows and Linux --- src/benchmarks/games.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/benchmarks/games.rs b/src/benchmarks/games.rs index 6d761b2..6a3ee2b 100644 --- a/src/benchmarks/games.rs +++ b/src/benchmarks/games.rs @@ -17,8 +17,13 @@ pub fn run_demd_benchmark() { } fn download_game_steam(game_id: u32) { + let mut steam_path = "steam"; + if cfg!(windows) { + steam_path = "C:\\Program Files (x86)\\Steam\\steam.exe"; + } + // first we need to make sure CS:GO is installed via Steam - let install_output = Command::new("C:\\Program Files (x86)\\Steam\\steam.exe") + let install_output = Command::new(steam_path) .arg(format!("steam://install/{}", game_id)) .output() .expect("Failed to execute command");