Added argument to vbs script

This commit is contained in:
Pax1601 2023-12-19 18:39:35 +01:00
parent 66ae06056b
commit 603018d1ef
3 changed files with 11 additions and 5 deletions

View File

@ -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() {

View File

@ -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
View File

@ -0,0 +1 @@
node .\\bin\\www