mirror of
https://github.com/Zagrios/bs-manager.git
synced 2026-07-03 14:08:25 +02:00
add button to lunch steam when steam is not running
This commit is contained in:
@@ -3,6 +3,7 @@ import regedit from 'regedit'
|
||||
import path from "path";
|
||||
import { parse } from "@node-steam/vdf";
|
||||
import { readFile } from "fs/promises";
|
||||
import { spawn } from "child_process";
|
||||
|
||||
export class SteamService{
|
||||
|
||||
@@ -62,4 +63,13 @@ export class SteamService{
|
||||
return null;
|
||||
}
|
||||
|
||||
public openSteam(): Promise<boolean>{
|
||||
const process = spawn("start", ["steam://open/games"], {shell: true});
|
||||
|
||||
return new Promise(resolve => {
|
||||
process.on("exit", () => resolve(true));
|
||||
process.on("error", () => resolve(false));
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user