From e520a50de2454fc5d881d95e0b53af61f162804b Mon Sep 17 00:00:00 2001 From: LenAnderson Date: Sat, 18 Nov 2023 00:09:42 +0000 Subject: [PATCH] add autorun command line argument --- server.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/server.js b/server.js index 64b1a108f..b1619e0e3 100644 --- a/server.js +++ b/server.js @@ -72,6 +72,11 @@ if (process.versions && process.versions.node && process.versions.node.match(/20 dns.setDefaultResultOrder('ipv4first'); const cliArguments = yargs(hideBin(process.argv)) + .option('autorun', { + type: 'boolean', + default: null, + describe: 'Automatically launch SillyTavern in the browser.' + }) .option('disableCsrf', { type: 'boolean', default: false, @@ -116,7 +121,7 @@ if (fs.existsSync(whitelistPath)) { } const whitelistMode = config.whitelistMode; -const autorun = config.autorun && !cliArguments.ssl; +const autorun = config.autorun && cliArguments.autorun!==false && !cliArguments.ssl; const enableExtensions = config.enableExtensions; const listen = config.listen;