Skip to content

Commit a9bfe5c

Browse files
committed
fixup! src: fix escaping of single quotes in task runner
1 parent bb0f717 commit a9bfe5c

5 files changed

Lines changed: 6 additions & 28 deletions

File tree

test/fixtures/run-script/node_modules/.bin/positional-args

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/fixtures/run-script/node_modules/.bin/positional-args.bat

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/fixtures/run-script/repeat-args.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

test/message/node_run_non_existent.out

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ Available scripts are:
1010
custom-env-windows: custom-env.bat
1111
path-env: path-env
1212
path-env-windows: path-env.bat
13-
repeat-args: node repeat-args.js
1413
special-env-variables: special-env-variables
1514
special-env-variables-windows: special-env-variables.bat
1615
pwd: pwd

test/parallel/test-node-run.js

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ common.requireNoPackageJSONAbove();
55

66
const { it, describe } = require('node:test');
77
const assert = require('node:assert');
8-
const path = require('node:path');
98

109
const fixtures = require('../common/fixtures');
1110
const envSuffix = common.isWindows ? '-windows' : '';
@@ -144,36 +143,19 @@ describe('node --run [command]', () => {
144143
it('appends positional arguments', async () => {
145144
const child = await common.spawnPromisified(
146145
process.execPath,
147-
[ '--run', `positional-args${envSuffix}`, '--', '--help "hello world test"', 'A', 'B', 'C'],
146+
[ '--run', `positional-args${envSuffix}`, '--', '--help "hello world test"', 'A', 'B', 'C', 'I think therefore I\'m'],
148147
{ cwd: fixtures.path('run-script') },
149148
);
150149
if (common.isWindows) {
151-
assert.match(child.stdout, /Arguments: '--help ""hello world test"" A B C'/);
150+
assert.match(child.stdout, /Arguments: '--help ""hello world test"" A B C "I think therefore I'm"'/);
152151
} else {
153-
assert.match(child.stdout, /Arguments: '--help "hello world test" A B C'/);
152+
assert.match(child.stdout, /Arguments: '--help "hello world test" A B C I think therefore I'm'/);
154153
}
155-
assert.match(child.stdout, /The total number of arguments are: 4/);
154+
assert.match(child.stdout, /The total number of arguments is: 5/);
156155
assert.strictEqual(child.stderr, '');
157156
assert.strictEqual(child.code, 0);
158157
});
159158

160-
it('handles positional arguments with quotes', async () => {
161-
const child = await common.spawnPromisified(
162-
process.execPath,
163-
[ '--run', 'repeat-args', '--', 'I think therefore I\'m'],
164-
{
165-
cwd: fixtures.path('run-script'),
166-
env: { ...process.env, PATH: `${path.dirname(process.execPath)}:${process.env.PATH}` },
167-
},
168-
);
169-
assert.deepStrictEqual(child, {
170-
stdout: `["I think therefore I'm"]\n`,
171-
stderr: '',
172-
code: 0,
173-
signal: null,
174-
});
175-
});
176-
177159
it('should set PATH environment variable with paths appended with node_modules/.bin', async () => {
178160
const child = await common.spawnPromisified(
179161
process.execPath,

0 commit comments

Comments
 (0)