Skip to content

Commit 38056e4

Browse files
Fixing bug when there are no args for executable files
1 parent 3f764a0 commit 38056e4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/otherCmd.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export function startProgram(
8888
let cmd;
8989
let args = [];
9090
if (desktopFilePath) {
91-
executableArgs = (executableArgs) ? ` ${executableArgs}`: "";
91+
executableArgs = executableArgs ? ` ${executableArgs}` : "";
9292
cmd = `awk`;
9393
args.push(
9494
`/^Exec=/ {sub("^Exec=", ""); gsub(" ?%[cDdFfikmNnUuv]", "${executableArgs}"); exit system($0)}`
@@ -98,7 +98,9 @@ export function startProgram(
9898
const parsedCmd = parseCmdArgs(executableFile);
9999
cmd = parsedCmd[0];
100100
args = parsedCmd[1];
101-
args = args.concat([executableArgs]);
101+
if (executableArgs) {
102+
args = args.concat([executableArgs]);
103+
}
102104
}
103105

104106
return new Promise(fulfill => {

0 commit comments

Comments
 (0)