Skip to content

Commit

Permalink
fix: only invoke a shell for docker commands known to cause problems …
Browse files Browse the repository at this point in the history
…on macos
  • Loading branch information
anacierdem committed Oct 20, 2024
1 parent faabaa4 commit bc88f2e
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 3 deletions.
4 changes: 4 additions & 0 deletions modules/actions/exec.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ const exec = async (info) => {
// spawnProcess defaults does not apply to dockerExec so we need to
// provide these explicitly here.
inheritStderr: true,
spawnOptions: {
...opts.spawnOptions,
shell: true,
},
...opts,
}
)
Expand Down
11 changes: 10 additions & 1 deletion modules/actions/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,16 @@ const initContainer = async (libdragonInfo) => {
'-R',
`${uid >= 0 ? uid : ''}:${gid >= 0 ? gid : ''}`,
'/n64_toolchain',
]
],
{
userCommand: false,
inheritStdin: true,
inheritStdout: false,
inheritStderr: false,
spawnOptions: {
shell: true,
},
}
);
} catch (e) {
// Dispose the invalid container, clean and exit
Expand Down
1 change: 0 additions & 1 deletion modules/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ function spawnProcess(
// Prevent the annoying docker "What's next?" message. It messes up everything.
DOCKER_CLI_HINTS: 'false',
},
shell: true,
...spawnOptions,
});

Expand Down
11 changes: 10 additions & 1 deletion modules/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,16 @@ const installDependencies = async (libdragonInfo) => {
CONTAINER_TARGET_PATH + '/' + libdragonInfo.vendorDirectory,
...dockerHostUserParams(libdragonInfo),
],
['/bin/bash', './build.sh']
['/bin/bash', './build.sh'],
{
userCommand: false,
inheritStdin: true,
inheritStdout: false,
inheritStderr: false,
spawnOptions: {
shell: true,
},
}
);
};

Expand Down

0 comments on commit bc88f2e

Please sign in to comment.