Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BREAKING] Replace console.log with process.stderr #930

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions scripts/buildSchema.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@ try {
await mkdir(path.dirname(TARGET_SCHEMA_PATH), {recursive: true});
await writeFile(TARGET_SCHEMA_PATH, JSON.stringify(schema, null, 2));

console.log(`Wrote bundled ${schemaName}.yaml schema file to ${TARGET_SCHEMA_PATH}`);
process.stderr.write(`Wrote bundled ${schemaName}.yaml schema file to ${TARGET_SCHEMA_PATH}\n`);
} catch (error) {
console.log(error);
process.stderr.write(error);
process.stderr.write("\n");
process.exit(1);
}

6 changes: 4 additions & 2 deletions scripts/generateCliDoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,12 @@ function generateDoc() {
try {
writeFileSync("./docs/pages/CLI.md", content);
} catch (err) {
console.error(`Failed to generate docs/pages/CLI.md: ${err.message}.`);
process.stderr.write(`Failed to generate docs/pages/CLI.md: ${err.message}.`);
process.stderr.write("\n");
throw err;
}
console.log("Generated docs/pages/CLI.md");
process.stderr.write("Generated docs/pages/CLI.md");
process.stderr.write("\n");
}

function splitString(temp) {
Expand Down
3 changes: 2 additions & 1 deletion scripts/hash.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ const fileBuffer = fs.readFileSync(filename);
const hashSum = crypto.createHash("md5");
hashSum.update(fileBuffer);

console.log(hashSum.digest("hex"));
process.stderr.write(hashSum.digest("hex"));
process.stderr.write("\n");
Comment on lines +18 to +19
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This breaks the use case of this script:

DOCKER_TAG=$(node ./hash.js ./Dockerfile)

With this change, DOCKER_TAG will be empty instead of containing the hash.

This should be reverted to console.log

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see a reason to adjust any of those scripts. They're not related to the productive shipment of packages and usage of console.log seems to be totally valid to me.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, I was wondering too. There's no need and nobody consumes these scripts outside of this repository. So we could also abandon this PR

Loading