Skip to content

Commit d9074c4

Browse files
committed
fix: spawn issue on windows relative to nodejs/node#52554
1 parent 4094cc0 commit d9074c4

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

.github/workflows/it-tests.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ jobs:
6565
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
6666
- uses: ./tools/github-actions/download-build-output
6767
- uses: ./tools/github-actions/setup
68+
- shell: bash
69+
run: |
70+
git config --global user.name "GitHub Actions"
71+
git config --global user.email "[email protected]"
6872
- uses: ./.github/actions/setup-java
6973
with:
7074
install-jdk: 'true'

packages/@ama-sdk/create/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ const run = () => {
9595
];
9696

9797
const errors = steps
98-
.map((step) => spawnSync(step.runner || process.execPath, step.args, { stdio: 'inherit', cwd: step.cwd || process.cwd() }))
98+
.map((step) => spawnSync(step.runner || process.execPath, step.args, { stdio: 'inherit', cwd: step.cwd || process.cwd(), shell: true }))
9999
.filter(({error, status}) => (error || status !== 0));
100100

101101
if (errors.length > 0) {

packages/@o3r/create/src/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,8 @@ const createNgProject = () => {
147147
.filter(([key]) => isNgNewOptions(key))
148148
.flat();
149149
exitProcessIfErrorInSpawnSync(1, spawnSync(process.execPath, [binPath, 'new', ...argv._, ...options], {
150-
stdio: 'inherit'
150+
stdio: 'inherit',
151+
shell: true
151152
}));
152153
};
153154

@@ -192,12 +193,14 @@ const prepareWorkspace = (relativeDirectory = '.', projectPackageManager = 'npm'
192193
if (projectPackageManager === 'yarn') {
193194
exitProcessIfErrorInSpawnSync(2, spawnSync(runner, ['set', 'version', argv['yarn-version'] || 'stable'], {
194195
stdio: 'inherit',
196+
shell: true,
195197
cwd
196198
}));
197199
}
198200

199201
exitProcessIfErrorInSpawnSync(2, spawnSync(runner, ['install'], {
200202
stdio: 'inherit',
203+
shell: true,
201204
cwd
202205
}));
203206
};
@@ -211,6 +214,7 @@ const addOtterFramework = (relativeDirectory = '.', projectPackageManager = 'npm
211214
exitProcessIfErrorInSpawnSync(3, spawnSync(runner, ['exec', 'ng', 'add', `@o3r/core@${exactO3rVersion ? '' : '~'}${version}`, ...(projectPackageManager === 'npm' ? ['--'] : []), ...options], {
212215
stdio: 'inherit',
213216
cwd,
217+
shell: true,
214218
env: exactO3rVersion && projectPackageManager === 'npm' ? {
215219
...process.env,
216220
// eslint-disable-next-line @typescript-eslint/naming-convention, camelcase

0 commit comments

Comments
 (0)