Improvements to deps and logging
This commit is contained in:
committed by
pullfrog[bot]
parent
1daf1571cf
commit
6e2a15c195
@@ -133,20 +133,25 @@ export const installNodeDependencies: PrepDefinition = {
|
||||
};
|
||||
}
|
||||
|
||||
log.info(`running: ${resolved.command} ${resolved.args.join(" ")}`);
|
||||
const fullCommand = `${resolved.command} ${resolved.args.join(" ")}`;
|
||||
log.info(`running: ${fullCommand}`);
|
||||
const result = await spawn({
|
||||
cmd: resolved.command,
|
||||
args: resolved.args,
|
||||
env: { PATH: process.env.PATH || "", HOME: process.env.HOME || "" },
|
||||
onStdout: (chunk) => process.stdout.write(chunk),
|
||||
onStderr: (chunk) => process.stderr.write(chunk),
|
||||
});
|
||||
|
||||
if (result.exitCode !== 0) {
|
||||
// combine stdout and stderr for better error context (pnpm often outputs errors to stdout)
|
||||
const output = [result.stdout, result.stderr].filter(Boolean).join("\n").trim();
|
||||
const errorMessage = output || `exited with code ${result.exitCode}`;
|
||||
return {
|
||||
language: "node",
|
||||
packageManager,
|
||||
dependenciesInstalled: false,
|
||||
issues: [result.stderr || `${resolved.command} exited with code ${result.exitCode}`],
|
||||
issues: [`\`${fullCommand}\` failed:\n${errorMessage}`],
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user