Skip to content

Commit 9782764

Browse files
author
Lionel Laské
committed
Add a message on CLI if launch error
1 parent ec01927 commit 9782764

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

main.js

+7
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ function createWindow () {
6969
} else if (process.argv[i] == '--logoff') {
7070
logoff = true;
7171
} else if (process.argv[i] == '--launch') {
72+
let found = false;
7273
if (i+1 < process.argv.length) {
7374
let activity = process.argv[i+1];
7475
if (activity.indexOf('&') != -1) {
@@ -77,9 +78,15 @@ function createWindow () {
7778
for (var j = 0 ; j < activities.length ; j++) {
7879
if (activities[j].id == activity) {
7980
launch = 'file://'+app.getAppPath()+'/'+activities[j].directory+'/index.html?n='+activities[j].name+'&a=' + process.argv[i+1];
81+
found = true;
8082
break;
8183
}
8284
}
85+
if (!found) {
86+
console.log('Warning: Activity "'+process.argv[i+1]+'" not found');
87+
}
88+
} else {
89+
console.log('Warning: No activity to launch provided');
8390
}
8491
}
8592
}

0 commit comments

Comments
 (0)