diff --git a/code.js b/code.js index e06d0a0..5d55dd5 100644 --- a/code.js +++ b/code.js @@ -12,8 +12,11 @@ const fd = fs.openSync("/proc/self/comm", fs.constants.O_WRONLY); fs.writeSync(fd, name); fs.closeSync(fd); -// Remove first command line argument (/usr/lib/code/code.js). - We call the CLI file first -process.argv.splice(0, 1); +// Remove this script command line argument (/usr/lib/code/code.js). - We call the CLI file first +const argi = process.argv.findIndex((arg) => arg == "/usr/lib/code/code.js"); +if (argi > -1) { + process.argv.splice(argi, 1); +} // Set application paths. const appPath = __dirname;