cli: fix --version (#551)

This commit is contained in:
bordun 2019-09-04 16:32:29 +02:00
parent 277e539abd
commit 83996488c7
2 changed files with 5 additions and 3 deletions

View file

@ -6,6 +6,7 @@
- keys: prevent default browser actions when a combo is bound to a widget (for example print dialog with ctrl+p)
- xy: broken `doubleTap`
- widget: error when two sibling widgets have a non-dynamic property depending on each others and on another widget at the same time
- cli: broken `--version` option
## 0.47.3

View file

@ -1,6 +1,8 @@
// This prevents argv parsing to be breaked when the app is packaged (executed without 'electron' prefix)
if (process.argv[1]&&process.argv[1].indexOf('-')==0) process.argv.unshift('')
var infos = require('../package.json')
var options = require('./options'),
argv = require('yargs')
.parserConfiguration({'boolean-negation': false})
@ -19,7 +21,7 @@ var options = require('./options'),
return err.length ? err.join('\n') : true
})
.strict()
.version().alias('v','version')
.version(infos.version).alias('v','version')
// litle hack to align long-only-options correctly
var h = argv.getUsageInstance().help
@ -38,8 +40,7 @@ for (i in argv) {
}
var fs = require('fs'),
ifaces = require('os').networkInterfaces(),
infos = require('../package.json')
ifaces = require('os').networkInterfaces()
var baseDir = process.env[(process.platform == 'win32') ? 'USERPROFILE' : 'HOME'],