Skip to content

Commit

Permalink
Fixed Windows Shell Usage
Browse files Browse the repository at this point in the history
  • Loading branch information
ObliviousHarmony committed Sep 17, 2024
1 parent 300557d commit 72123f7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/phpcs-report/__tests__/worker-integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ describe('Worker/WorkerPool Integration', () => {
);

try {
child_process.execFileSync(phpcsPath, ['--version']);
child_process.execFileSync(phpcsPath, ['--version'], {
shell: true,
});
} catch (e) {
throw new Error(
'PHPCS could not be found at "' +
Expand Down
4 changes: 3 additions & 1 deletion src/phpcs-report/__tests__/worker.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ describe('Worker', () => {
);

try {
child_process.execFileSync(phpcsPath, ['--version']);
child_process.execFileSync(phpcsPath, ['--version'], {
shell: true,
});
} catch (e) {
console.log(e);
throw new Error(
Expand Down
2 changes: 2 additions & 0 deletions src/phpcs-report/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,8 @@ export class Worker {
}),
},
windowsHide: true,
// Node requires that the shell option be used on Windows to execute batch scripts.
shell: process.platform === 'win32' ? true : false,
};

// Make sure PHPCS knows to read from STDIN.
Expand Down

0 comments on commit 72123f7

Please sign in to comment.