Skip to content
Permalink
Browse files Browse the repository at this point in the history
fix: escape child process arguments
  • Loading branch information
gitphill committed Nov 29, 2022
1 parent 13c6f33 commit 02cda9b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .snyk
@@ -0,0 +1,10 @@
# Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities.
version: v1.25.0
# ignores vulnerabilities until expiry date; change duration by modifying expiry date
ignore:
'snyk:lic:npm:shescape:MPL-2.0':
- '*':
reason: None Given
expires: 2122-12-29T08:08:41.608Z
created: 2022-11-29T08:08:41.611Z
patch: {}
4 changes: 4 additions & 0 deletions lib/sub-process.ts
@@ -1,5 +1,6 @@
import * as childProcess from 'child_process';
import { debug } from './index';
import { quoteAll } from 'shescape';

export function execute(command, args, options): Promise<string> {
const spawnOptions: {
Expand All @@ -9,6 +10,9 @@ export function execute(command, args, options): Promise<string> {
if (options && options.cwd) {
spawnOptions.cwd = options.cwd;
}
if (args) {
args = quoteAll(args, spawnOptions);
}

return new Promise((resolve, reject) => {
let stdout = '';
Expand Down
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -48,6 +48,7 @@
"debug": "^4.1.1",
"glob": "^7.1.6",
"needle": "^2.5.0",
"shescape": "1.6.1",
"tslib": "^2.4.0"
}
}

0 comments on commit 02cda9b

Please sign in to comment.