Skip to content

Commit

Permalink
Add a message on CLI if launch error
Browse files Browse the repository at this point in the history
  • Loading branch information
Lionel Laské committed Dec 28, 2024
1 parent ec01927 commit 9782764
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ function createWindow () {
} else if (process.argv[i] == '--logoff') {
logoff = true;
} else if (process.argv[i] == '--launch') {
let found = false;
if (i+1 < process.argv.length) {
let activity = process.argv[i+1];
if (activity.indexOf('&') != -1) {
Expand All @@ -77,9 +78,15 @@ function createWindow () {
for (var j = 0 ; j < activities.length ; j++) {
if (activities[j].id == activity) {
launch = 'file://'+app.getAppPath()+'/'+activities[j].directory+'/index.html?n='+activities[j].name+'&a=' + process.argv[i+1];
found = true;
break;
}
}
if (!found) {
console.log('Warning: Activity "'+process.argv[i+1]+'" not found');
}
} else {
console.log('Warning: No activity to launch provided');
}
}
}
Expand Down

0 comments on commit 9782764

Please sign in to comment.