fix version flags displaying bad version on linux (#1422) (#2089)

yargs, the command line parsing library, was unable to read the app's version automatically from package.json
fix by passing the app's version as electron sees it
This commit is contained in:
vas
2022-05-10 22:52:33 +03:00
committed by GitHub
parent 4ebaebfd17
commit 8dd7d3dcc5
4 changed files with 43 additions and 22 deletions

View File

@@ -138,12 +138,6 @@ export async function initialize() {
function initializeArgs() {
global.args = parseArgs(process.argv.slice(1));
// output the application version via cli when requested (-v or --version)
if (global.args.version) {
process.stdout.write(`v.${app.getVersion()}\n`);
process.exit(0); // eslint-disable-line no-process-exit
}
global.isDev = isDev && !global.args.disableDevMode; // this doesn't seem to be right and isn't used as the single source of truth
if (global.args.dataDir) {