diff --git a/code.js b/code.js index e06d0a0..0835e25 100644 --- a/code.js +++ b/code.js @@ -12,8 +12,8 @@ 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 electron command line arguments. +process.argv.splice(0, process.argv.findIndex((arg) => arg == "--") + 1); // Set application paths. const appPath = __dirname; diff --git a/code.sh b/code.sh index 55947fe..a064cfa 100644 --- a/code.sh +++ b/code.sh @@ -32,4 +32,4 @@ for line in "${ELECTRONMAPFILE[@]}"; do fi done -ELECTRON_RUN_AS_NODE=1 exec /usr/lib/${name}/electron /usr/lib/code/out/cli.js "${electronflags[@]}" /usr/lib/code/code.js "${codeflags[@]}" "$@" +ELECTRON_RUN_AS_NODE=1 exec /usr/lib/${name}/electron /usr/lib/code/out/cli.js "${electronflags[@]}" /usr/lib/code/code.js "${codeflags[@]}" -- "$@"