Add --version flag to print atom-shell's version.
This commit is contained in:
parent
7f7e13edc3
commit
0483871388
1 changed files with 6 additions and 1 deletions
|
@ -1,5 +1,4 @@
|
|||
var app = require('app');
|
||||
var argv = require('optimist').argv;
|
||||
var dialog = require('dialog');
|
||||
var path = require('path');
|
||||
|
||||
|
@ -9,6 +8,9 @@ app.on('window-all-closed', function() {
|
|||
app.quit();
|
||||
});
|
||||
|
||||
process.argv.splice(1, 0, 'dummyScript');
|
||||
var argv = require('optimist').argv;
|
||||
|
||||
// Start the specified app if there is one specified in command line, otherwise
|
||||
// start the default app.
|
||||
if (argv._.length > 0) {
|
||||
|
@ -23,6 +25,9 @@ if (argv._.length > 0) {
|
|||
throw e;
|
||||
}
|
||||
}
|
||||
} else if (argv.version) {
|
||||
console.log(process.versions['atom-shell']);
|
||||
process.exit(0);
|
||||
} else {
|
||||
require('./default_app.js');
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue