Skip to content

Commit

Permalink
fix(shaka-lab-node): Fix startup on Windows (#61)
Browse files Browse the repository at this point in the history
A recent batch of updates changed the ability of nodejs to run a .cmd
script directly. This fixes it with an option to spawnSync.
  • Loading branch information
joeyparrish authored Sep 20, 2024
1 parent a1fd900 commit 5b76b0b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion shaka-lab-node/start-nodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,13 @@ function main() {
// Update WebDrivers on startup.
// This has a side-effect of also installing other requirements, such as
// js-yaml, which we don't load until we need it below.
const updateSpawnOptions = Object.assign({}, spawnOptions);
if (process.platform == 'win32') {
// To run the .cmd script in the latest nodejs, you must pass shell=true.
updateSpawnOptions.shell = true;
}
const updateProcess = child_process.spawnSync(
updateDrivers, /* args= */ [], spawnOptions);
updateDrivers, /* args= */ [], updateSpawnOptions);
if (updateProcess.status) {
throw new Error(
`Driver update failed with exit code ${updateProcess.status}`);
Expand Down

0 comments on commit 5b76b0b

Please sign in to comment.