Skip to content

Commit ad6d93a

Browse files
authored
Merge pull request #31 from snyk/fix/quote-args
fix: quote args
2 parents eb1737c + c73e049 commit ad6d93a

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

.snyk

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities.
2-
version: v1.13.5
3-
ignore: {}
2+
version: v1.25.0
3+
# ignores vulnerabilities until expiry date; change duration by modifying expiry date
4+
ignore:
5+
'snyk:lic:npm:shescape:MPL-2.0':
6+
- '*':
7+
reason: None Given
8+
expires: 2022-12-29T09:11:54.820Z
9+
created: 2022-11-29T09:11:54.829Z
410
# patches apply the minimum changes required to fix a vulnerability
511
patch:
612
SNYK-JS-LODASH-450202:

lib/sub-process.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import * as childProcess from 'child_process';
2+
import { quoteAll } from 'shescape';
23

34
export function execute(
45
command: string,
@@ -13,6 +14,8 @@ export function execute(
1314
spawnOptions.cwd = options.cwd;
1415
}
1516

17+
args = quoteAll(args, spawnOptions);
18+
1619
return new Promise((resolve, reject) => {
1720
let stdout = '';
1821
let stderr = '';

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"@snyk/cli-interface": "^2.11.0",
3535
"@snyk/cocoapods-lockfile-parser": "3.6.2",
3636
"@snyk/dep-graph": "^1.23.1",
37+
"shescape": "1.6.1",
3738
"source-map-support": "^0.5.7",
3839
"tslib": "^2.0.0"
3940
},

test/lib/sub-process.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ describe('execute()', () => {
2727

2828
test('Considers option.cwd', async () => {
2929
await expect(
30-
subProcess.execute('basename', ['$PWD'], { cwd: __dirname }),
30+
subProcess.execute('basename $PWD', [], { cwd: __dirname }),
3131
).resolves.toEqual('lib\n');
3232
});
3333

0 commit comments

Comments
 (0)