mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
Added argument to vbs script
This commit is contained in:
parent
66ae06056b
commit
603018d1ef
@ -2,13 +2,18 @@ const { app, BrowserWindow } = require('electron/main')
|
||||
const path = require('path')
|
||||
const fs = require('fs')
|
||||
const { spawn } = require('child_process');
|
||||
const yargs = require('yargs');
|
||||
|
||||
const jsonPath = ("..", "olympus.json");
|
||||
yargs.alias('c', 'config').describe('c', 'olympus.json config location').string('rp');
|
||||
args = yargs.argv;
|
||||
|
||||
console.log(`Config location: ${args["config"]}`)
|
||||
var clientPort = 3000;
|
||||
|
||||
if (fs.existsSync(jsonPath)) {
|
||||
var json = JSON.parse(fs.readFileSync(jsonPath, 'utf-8'));
|
||||
if (fs.existsSync(args["config"])) {
|
||||
var json = JSON.parse(fs.readFileSync(args["config"], 'utf-8'));
|
||||
clientPort = json["client"]["port"];
|
||||
} else {
|
||||
console.log("Failed to read config, trying default port");
|
||||
}
|
||||
|
||||
function createWindow() {
|
||||
|
||||
@ -1 +1 @@
|
||||
CreateObject("Wscript.Shell").Run "npm run client", 0
|
||||
CreateObject("Wscript.Shell").Run "npm run client -- --config """&WScript.Arguments(0)&"""", 1
|
||||
1
client/server.bat
Normal file
1
client/server.bat
Normal file
@ -0,0 +1 @@
|
||||
node .\\bin\\www
|
||||
Loading…
x
Reference in New Issue
Block a user