Skip to content

Commit

Permalink
Use shell-quote (#58)
Browse files Browse the repository at this point in the history
Follow up #57
  • Loading branch information
asamuzaK committed May 13, 2024
1 parent 3764ee4 commit 20bd4a4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions modules/child-process.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import childProcess from 'node:child_process';
import os from 'node:os';
import path from 'node:path';
import process from 'node:process';
import { parse } from 'shell-quote';
import { parse, quote } from 'shell-quote';
import { getType, isString } from './common.js';
import { isExecutable, isFile } from './file-util.js';

Expand All @@ -27,7 +27,7 @@ export class ChildProcess {
constructor(cmd, args, opt) {
this.#cmd = isString(cmd) ? cmd : null;
if (Array.isArray(args)) {
this.#args = args;
this.#args = parse(quote(args));
} else if (args && isString(args)) {
this.#args = parse(args);
} else {
Expand Down
3 changes: 2 additions & 1 deletion modules/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import path from 'node:path';
import process from 'node:process';
import readline from 'readline-sync';
import { parse } from 'shell-quote';
import { browserData } from './browser-data.js';
import { ChildProcess } from './child-process.js';
import { getType, isString, quoteArg, throwErr } from './common.js';
Expand Down Expand Up @@ -326,7 +327,7 @@ export class Setup {
const { regWin } = this.#browser;
const regKey = path.join(...regWin, this.#hostName);
const reg = path.join(process.env.WINDIR, 'system32', 'reg.exe');
const args = ['add', regKey, '/ve', '/d', manifestPath, '/f'];
const args = parse(`add ${regKey} /ve /d ${manifestPath} /f`);
const opt = {
cwd: null,
encoding: CHAR,
Expand Down

0 comments on commit 20bd4a4

Please sign in to comment.