Verified Commit 0970aeb7 authored by Camil Staps's avatar Camil Staps 🚀

When started with --gdb, do not start iTasks but show instructions for how to run it in gdb

parent 22581fe9
const fs=require ('fs').promises;
const net=require ('net');
const path=require ('path');
const process=require ('process');
const spawn=require ('child_process').spawn;
const {app,ipcMain,ipcRenderer}=require ('electron');
......@@ -207,13 +208,19 @@ function run (_opts) {
const opts=DEFAULTS;
Object.assign (opts,_opts);
const exe='./'+opts.app+'.exe';
const args=['serve','--electron-port',opts.port,'--port',opts.itasks_port];
const server=spawn ('./'+opts.app+'.exe',args,{stdio: 'inherit'});
server.on ('close',code => {
if (code!==0 && code!==null)
console.log ('iTasks exited with exit code '+code);
app.quit(code);
});
if (process.argv.indexOf ('--gdb')>=0){
console.log ('Run the following in a separate window:');
console.log ('gdb '+exe+' -ex \'r '+args.join (' ')+'\'');
} else {
const server=spawn (exe,args,{stdio: 'inherit'});
server.on ('close',code => {
if (code!==0 && code!==null)
console.log ('iTasks exited with exit code '+code);
app.quit(code);
});
}
return Component.instantiate (opts);
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment