Skip to content

Commit

Permalink
fix: spawn issue on windows relative to nodejs/node#52554
Browse files Browse the repository at this point in the history
  • Loading branch information
kpanot authored and mrednic-1A committed Apr 18, 2024
1 parent 8a12a60 commit 8c6b682
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/it-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ jobs:
- uses: actions/checkout@v4
- uses: ./tools/github-actions/download-build-output
- uses: ./tools/github-actions/setup
- shell: bash
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "AmadeusITGroup-otter@users.noreply.github.com"
- uses: ./.github/actions/setup-java
with:
install-jdk: 'true'
Expand Down
2 changes: 1 addition & 1 deletion packages/@ama-sdk/create/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ const run = () => {
];

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

if (errors.length > 0) {
Expand Down
6 changes: 5 additions & 1 deletion packages/@o3r/create/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ const createNgProject = () => {
.filter(([key]) => isNgNewOptions(key))
.flat();
exitProcessIfErrorInSpawnSync(1, spawnSync(process.execPath, [binPath, 'new', ...argv._, ...options], {
stdio: 'inherit'
stdio: 'inherit',
shell: true
}));
};

Expand Down Expand Up @@ -192,12 +193,14 @@ const prepareWorkspace = (relativeDirectory = '.', projectPackageManager = 'npm'
if (projectPackageManager === 'yarn') {
exitProcessIfErrorInSpawnSync(2, spawnSync(runner, ['set', 'version', argv['yarn-version'] || 'stable'], {
stdio: 'inherit',
shell: true,
cwd
}));
}

exitProcessIfErrorInSpawnSync(2, spawnSync(runner, ['install'], {
stdio: 'inherit',
shell: true,
cwd
}));
};
Expand All @@ -211,6 +214,7 @@ const addOtterFramework = (relativeDirectory = '.', projectPackageManager = 'npm
exitProcessIfErrorInSpawnSync(3, spawnSync(runner, ['exec', 'ng', 'add', `@o3r/core@${exactO3rVersion ? '' : '~'}${version}`, ...(projectPackageManager === 'npm' ? ['--'] : []), ...options], {
stdio: 'inherit',
cwd,
shell: true,
env: exactO3rVersion && projectPackageManager === 'npm' ? {
...process.env,
// eslint-disable-next-line @typescript-eslint/naming-convention, camelcase
Expand Down

0 comments on commit 8c6b682

Please sign in to comment.