Improvements to deps and logging

This commit is contained in:
Colin McDonnell
2026-01-15 00:01:38 +00:00
committed by pullfrog[bot]
parent 1daf1571cf
commit 6e2a15c195
5 changed files with 132 additions and 136 deletions
+7 -2
View File
@@ -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}`],
};
}