mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
Add --version flag to print atom-shell's version.
This commit is contained in:
@@ -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');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user