Skip to content

Commit ae5fb7d

Browse files
Merge pull request #3192 from nestjs/fix/revert-3128
fix: revert #3128
2 parents 87c2eca + 78e7571 commit ae5fb7d

File tree

3 files changed

+5
-104
lines changed

3 files changed

+5
-104
lines changed

actions/start.action.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { red } from 'ansis';
22
import { spawn } from 'child_process';
33
import * as fs from 'fs';
44
import { join } from 'path';
5-
import { platform } from 'os';
65
import { Input } from '../commands';
76
import { getTscConfigPath } from '../lib/compiler/helpers/get-tsc-config.path';
87
import { getValueOrDefault } from '../lib/compiler/helpers/get-value-or-default';
@@ -12,8 +11,8 @@ import {
1211
} from '../lib/configuration/defaults';
1312
import { ERROR_PREFIX } from '../lib/ui';
1413
import { treeKillSync as killProcessSync } from '../lib/utils/tree-kill';
15-
import { BuildAction } from './build.action';
1614
import { assertNonArray } from '../lib/utils/type-assertions';
15+
import { BuildAction } from './build.action';
1716

1817
export class StartAction extends BuildAction {
1918
public async handle(commandInputs: Input[], commandOptions: Input[]) {
@@ -79,8 +78,7 @@ export class StartAction extends BuildAction {
7978
const shellOption = commandOptions.find(
8079
(option) => option.name === 'shell',
8180
);
82-
const isWindows = platform() === 'win32';
83-
const useShell = shellOption?.value !== false && isWindows;
81+
const useShell = !!shellOption?.value;
8482

8583
const envFileOption = commandOptions.find(
8684
(option) => option.name === 'envFile',

lib/runners/abstract.runner.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ export class AbstractRunner {
1919
const options: SpawnOptions = {
2020
cwd,
2121
stdio: collect ? 'pipe' : 'inherit',
22-
shell: isWindows,
22+
shell: true,
2323
};
2424
return new Promise<null | string>((resolve, reject) => {
2525
const child: ChildProcess = spawn(
26-
this.binary,
26+
`${this.binary}`,
2727
[...this.args, ...args],
2828
options,
2929
);
@@ -37,9 +37,7 @@ export class AbstractRunner {
3737
resolve(null);
3838
} else {
3939
console.error(
40-
red(
41-
MESSAGES.RUNNER_EXECUTION_ERROR(`${this.binary} ${command}`),
42-
),
40+
red(MESSAGES.RUNNER_EXECUTION_ERROR(`${this.binary} ${command}`)),
4341
);
4442
reject();
4543
}

test/lib/runners/abstract.runner.security.spec.ts

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

0 commit comments

Comments
 (0)