Require only one autorun argument to be true

This commit is contained in:
Cohee
2023-12-07 00:55:36 +02:00
parent e65d1ad20f
commit 6a516bf3eb

View File

@@ -74,7 +74,7 @@ dns.setDefaultResultOrder('ipv4first');
const cliArguments = yargs(hideBin(process.argv)) const cliArguments = yargs(hideBin(process.argv))
.option('autorun', { .option('autorun', {
type: 'boolean', type: 'boolean',
default: true, default: false,
describe: 'Automatically launch SillyTavern in the browser.', describe: 'Automatically launch SillyTavern in the browser.',
}).option('corsProxy', { }).option('corsProxy', {
type: 'boolean', type: 'boolean',
@@ -124,7 +124,7 @@ if (fs.existsSync(whitelistPath)) {
} }
const whitelistMode = getConfigValue('whitelistMode', true); const whitelistMode = getConfigValue('whitelistMode', true);
const autorun = getConfigValue('autorun', false) && cliArguments.autorun && !cliArguments.ssl; const autorun = (getConfigValue('autorun', false) || cliArguments.autorun) && !cliArguments.ssl;
const enableExtensions = getConfigValue('enableExtensions', true); const enableExtensions = getConfigValue('enableExtensions', true);
const listen = getConfigValue('listen', false); const listen = getConfigValue('listen', false);