Skip to content

Commit

Permalink
Fix code scanning alert no. 1: Shell command built from environment v…
Browse files Browse the repository at this point in the history
…alues (#1028)

* Fix code scanning alert no. 1: Shell command built from environment values

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* Fix indent issue

---------

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
  • Loading branch information
lexie011 and github-advanced-security[bot] authored Nov 11, 2024
1 parent 584fd00 commit a8de163
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/debugger/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,15 @@ export function cordovaStartCommand(
export function killTree(processId: number): void {
const cmd =
process.platform === "win32"
? "taskkill.exe /F /T /PID"
? "taskkill.exe"
: path.join(findFileInFolderHierarchy(__dirname, "scripts"), "terminateProcess.sh");
const args =
process.platform === "win32"
? ["/F", "/T", "/PID", processId.toString()]
: [processId.toString()];

try {
child_process.execSync(`${cmd} ${processId}`);
child_process.execFileSync(cmd, args);
} catch (err) {}
}

Expand Down

0 comments on commit a8de163

Please sign in to comment.