Skip to content

Commit fd68242

Browse files
committed
app: electron: Replace execSync with execFileSync
1 parent ced9dec commit fd68242

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

app/electron/main.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { ChildProcessWithoutNullStreams, exec, execSync, spawn } from 'child_process';
17+
import { ChildProcessWithoutNullStreams, exec, execFileSync, spawn } from 'child_process';
1818
import { randomBytes } from 'crypto';
1919
import dotenv from 'dotenv';
2020
import {
@@ -91,7 +91,7 @@ const args = yargs(hideBin(process.argv))
9191
() => {
9292
try {
9393
const backendPath = path.join(process.resourcesPath, 'headlamp-server');
94-
const stdout = execSync(`${backendPath} list-plugins`);
94+
const stdout = execFileSync(backendPath, ['list-plugins']);
9595
process.stdout.write(stdout);
9696
process.exit(0);
9797
} catch (error) {
@@ -1090,7 +1090,7 @@ async function getRunningHeadlampPIDs() {
10901090
function killProcess(pid: number) {
10911091
if (process.platform === 'win32') {
10921092
// Otherwise on Windows the process will stick around.
1093-
execSync('taskkill /pid ' + pid + ' /T /F');
1093+
execFileSync('taskkill', ['/pid', String(pid), '/T', '/F']);
10941094
} else {
10951095
process.kill(pid, 'SIGHUP');
10961096
}

0 commit comments

Comments
 (0)