Also report when user provided strange files.
This commit is contained in:
parent
f0e5cae9bb
commit
0e7c7ca34b
1 changed files with 9 additions and 13 deletions
|
@ -17,19 +17,15 @@ if (argv._.length > 0) {
|
||||||
try {
|
try {
|
||||||
require(path.resolve(argv._[0]));
|
require(path.resolve(argv._[0]));
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
if (e.code == 'MODULE_NOT_FOUND') {
|
app.focus();
|
||||||
app.focus();
|
dialog.showMessageBox({
|
||||||
dialog.showMessageBox({
|
type: 'warning',
|
||||||
type: 'warning',
|
buttons: ['OK'],
|
||||||
buttons: ['OK'],
|
title: 'Error opening app',
|
||||||
title: 'Error opening app',
|
message: 'The app provided is not a valid atom-shell app, please read the docs on how to write one:',
|
||||||
message: 'The app provided is not a valid atom-shell app, please read the docs on how to write one:',
|
detail: 'https://github.com/atom/atom-shell/tree/master/docs'
|
||||||
detail: 'https://github.com/atom/atom-shell/tree/master/docs'
|
});
|
||||||
});
|
process.exit(1);
|
||||||
process.exit(1);
|
|
||||||
} else {
|
|
||||||
throw e;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else if (argv.version) {
|
} else if (argv.version) {
|
||||||
console.log('v' + process.versions['atom-shell']);
|
console.log('v' + process.versions['atom-shell']);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue