Skip to content

Commit e7436c4

Browse files
test: use execFile in CLI tests to avoid shell word-splitting for paths with spaces
1 parent 35faa2a commit e7436c4

File tree

1 file changed

+5
-4
lines changed
  • lib/node_modules/@stdlib/_tools/benchmarks/browser-build/test

1 file changed

+5
-4
lines changed

lib/node_modules/@stdlib/_tools/benchmarks/browser-build/test/test.cli.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
var resolve = require( 'path' ).resolve;
2424
var exec = require( 'child_process' ).exec;
25+
var execFile = require( 'child_process' ).execFile;
2526
var tape = require( 'tape' );
2627
var IS_BROWSER = require( '@stdlib/assert/is-browser' );
2728
var IS_WINDOWS = require( '@stdlib/assert/is-windows' );
@@ -62,7 +63,7 @@ tape( 'when invoked with a `--help` flag, the command-line interface prints the
6263
'--help'
6364
];
6465

65-
exec( cmd.join( ' ' ), done );
66+
execFile( cmd[ 0 ], cmd.slice( 1 ), done );
6667

6768
function done( error, stdout, stderr ) {
6869
if ( error ) {
@@ -88,7 +89,7 @@ tape( 'when invoked with a `-h` flag, the command-line interface prints the help
8889
'-h'
8990
];
9091

91-
exec( cmd.join( ' ' ), done );
92+
execFile( cmd[ 0 ], cmd.slice( 1 ), done );
9293

9394
function done( error, stdout, stderr ) {
9495
if ( error ) {
@@ -108,7 +109,7 @@ tape( 'when invoked with a `--version` flag, the command-line interface prints t
108109
'--version'
109110
];
110111

111-
exec( cmd.join( ' ' ), done );
112+
execFile( cmd[ 0 ], cmd.slice( 1 ), done );
112113

113114
function done( error, stdout, stderr ) {
114115
if ( error ) {
@@ -128,7 +129,7 @@ tape( 'when invoked with a `-V` flag, the command-line interface prints the vers
128129
'-V'
129130
];
130131

131-
exec( cmd.join( ' ' ), done );
132+
execFile( cmd[ 0 ], cmd.slice( 1 ), done );
132133

133134
function done( error, stdout, stderr ) {
134135
if ( error ) {

0 commit comments

Comments
 (0)