()
| 8 | import { getCommonHeaders } from "../common/network"; |
| 9 | |
| 10 | export async function initSteamCmd() { |
| 11 | try { |
| 12 | if (!fs.existsSync(STEAM_CMD_PATH) && SYSTEM_TYPE === "win32") { |
| 13 | const zipPath = await downloadSteam(WINDOWS_STEAM_CMD_URL); |
| 14 | await new FileManager().unzip(zipPath, "lib", "utf-8"); |
| 15 | await fs.remove(zipPath); |
| 16 | } |
| 17 | } catch (error) { |
| 18 | logger.error(`Steam command line tool download failed: ${error}`); |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | export async function downloadSteam(url: string): Promise<string> { |
| 23 | const tmpPath = path.normalize(path.join(process.cwd(), "lib", "tmp_steamcmd.zip")); |
no test coverage detected