Skip to content

Commit 9aaf184

Browse files
Use execFile to run safily pass arguments
1 parent af147ea commit 9aaf184

File tree

1 file changed

+3
-3
lines changed
  • src/op-cli-installer/github-action/cli-installer

1 file changed

+3
-3
lines changed

src/op-cli-installer/github-action/cli-installer/macos.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { exec } from "child_process";
1+
import { execFile } from "child_process";
22
import * as fs from "fs";
33
import * as path from "path";
44
import { promisify } from "util";
@@ -13,7 +13,7 @@ import {
1313
} from "./cli-installer";
1414
import { type Installer } from "./installer";
1515

16-
const execAsync = promisify(exec);
16+
const execFileAsync = promisify(execFile);
1717

1818
export class MacOsInstaller extends CliInstaller implements Installer {
1919
private readonly platform: SupportedPlatform = "darwin"; // Node.js platform identifier for macOS
@@ -35,7 +35,7 @@ export class MacOsInstaller extends CliInstaller implements Installer {
3535
fs.renameSync(pkgPath, pkgWithExtension);
3636

3737
const expandDir = "temp-pkg";
38-
await execAsync(`pkgutil --expand "${pkgWithExtension}" "${expandDir}"`);
38+
await execFileAsync("pkgutil", ["--expand", pkgWithExtension, expandDir]);
3939
const payloadPath = path.join(expandDir, "op.pkg", "Payload");
4040
console.info("Installing 1Password CLI");
4141
const cliPath = await tc.extractTar(payloadPath);

0 commit comments

Comments
 (0)