Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/node/utils/Cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,30 +25,34 @@
export const argv: Record<string, string> = {};

const argvInternal = process.argv.slice(2);
let arg, prevArg;
let arg, prevArg = "";

// Loop through args
for (let i = 0; i < argvInternal.length; i++) {
arg = argvInternal[i];

// Override location of settings.json file
if (prevArg && prevArg === '--settings' || prevArg === '-s') {
console.log("Using specified settings from command line");
argv.settings = arg;
}

// Override location of credentials.json file
if (prevArg && prevArg === '--credentials') {
exports.argv.credentials = arg;
console.log("Using specified credentials from command line");
argv.credentials = arg;
}

// Override location of settings.json file
if (prevArg && prevArg === '--sessionkey') {
exports.argv.sessionkey = arg;
console.log("Using specified session key from command line");
argv.sessionkey = arg;
}

// Override location of APIKEY.txt file
if (prevArg && prevArg === '--apikey') {
exports.argv.apikey = arg;
console.log("Using specified API key from command line");
argv.apikey = arg;
}

prevArg = arg;
Expand Down
Loading