Update scripts for compatibility with latest NodeJS Security Release (#1628)

Co-authored-by: David Baker <dbkr@users.noreply.github.com>
This commit is contained in:
Michael Telatynski 2024-04-17 15:12:29 +01:00 committed by GitHub
parent d1fd69f938
commit 193de5182f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 17 additions and 0 deletions

View file

@ -32,6 +32,9 @@ export default async function buildKeytar(hakEnv: HakEnv, moduleInfo: Dependency
cwd: moduleInfo.moduleBuildDir,
env,
stdio: "inherit",
// We need shell mode on Windows to be able to launch `.cmd` executables
// See https://nodejs.org/en/blog/vulnerability/april-2024-security-releases-2
shell: hakEnv.isWin(),
},
);
proc.on("exit", (code) => {

View file

@ -44,6 +44,9 @@ export default async function fetch(hakEnv: HakEnv, moduleInfo: DependencyInfo):
const proc = childProcess.spawn(hakEnv.isWin() ? "yarn.cmd" : "yarn", ["install", "--ignore-scripts"], {
stdio: "inherit",
cwd: moduleInfo.moduleBuildDir,
// We need shell mode on Windows to be able to launch `.cmd` executables
// See https://nodejs.org/en/blog/vulnerability/april-2024-security-releases-2
shell: hakEnv.isWin(),
});
proc.on("exit", (code) => {
code ? reject(code) : resolve();

View file

@ -53,6 +53,9 @@ export default async function link(hakEnv: HakEnv, moduleInfo: DependencyInfo):
const proc = childProcess.spawn(yarnCmd, ["link"], {
cwd: moduleInfo.moduleOutDir,
stdio: "inherit",
// We need shell mode on Windows to be able to launch `.cmd` executables
// See https://nodejs.org/en/blog/vulnerability/april-2024-security-releases-2
shell: hakEnv.isWin(),
});
proc.on("exit", (code) => {
code ? reject(code) : resolve();
@ -63,6 +66,9 @@ export default async function link(hakEnv: HakEnv, moduleInfo: DependencyInfo):
const proc = childProcess.spawn(yarnCmd, ["link", moduleInfo.name], {
cwd: hakEnv.projectRoot,
stdio: "inherit",
// We need shell mode on Windows to be able to launch `.cmd` executables
// See https://nodejs.org/en/blog/vulnerability/april-2024-security-releases-2
shell: hakEnv.isWin(),
});
proc.on("exit", (code) => {
code ? reject(code) : resolve();

View file

@ -32,6 +32,11 @@ export async function setPackageVersion(ver: string): Promise<void> {
"--new-version",
ver,
],
{
// We need shell mode on Windows to be able to launch `.cmd` executables
// See https://nodejs.org/en/blog/vulnerability/april-2024-security-releases-2
shell: process.platform === "win32",
},
(err) => {
if (err) {
reject(err);