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 committed Apr 17, 2024
1 parent 4094cc0 commit 912a385
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/it-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,13 @@ jobs:
PREPARE_TEST_ENV_TYPE: ${{ matrix.testEnvironment }}
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: fregante/setup-git-user@v2
- 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 "[email protected]"
- 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 @@ -95,7 +95,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 912a385

Please sign in to comment.