Skip to content

Commit

Permalink
Use process.stdout.write
Browse files Browse the repository at this point in the history
  • Loading branch information
LitoMore committed May 2, 2024
1 parent 7e84ad2 commit 904bfc9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
8 changes: 4 additions & 4 deletions scripts/add-icon-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ try {
: undefined,
};

console.log(
process.stdout.write(
'About to write the following to simple-icons.json:\n' +
JSON.stringify(answers, null, 4),
);
Expand All @@ -134,14 +134,14 @@ try {
iconsData.icons.push(answers);
iconsData.icons.sort((a, b) => collator.compare(a.title, b.title));
await writeIconsData(iconsData);
console.log(chalk.green('\nData written successfully.'));
process.stdout.write(chalk.green('\nData written successfully.'));
} else {
console.log(chalk.red('\nAborted.'));
process.stdout.write(chalk.red('\nAborted.'));
process.exit(1);
}
} catch (error) {
if (error instanceof ExitPromptError) {
console.log(chalk.red('\nAborted.'));
process.stdout.write(chalk.red('\nAborted.'));
process.exit(1);
}

Expand Down
4 changes: 3 additions & 1 deletion scripts/get-filename.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,7 @@ if (process.argv.length < 3) {
} else {
const brandName = process.argv[2];
const filename = titleToSlug(brandName);
console.log(`For '${brandName}' use the file 'icons/${filename}.svg'`);
process.stdout.write(
`For '${brandName}' use the file 'icons/${filename}.svg'`,
);
}
4 changes: 2 additions & 2 deletions scripts/release/update-sdk-ts-defs.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const generateSdkMts = async () => {
);
} catch (error) {
await fs.writeFile(sdkMjs, originalSdkMjsContent);
console.log(
process.stdout.write(
`Error ${error.status} generating Typescript` +
` definitions: '${error.message}'`,
);
Expand Down Expand Up @@ -67,7 +67,7 @@ const generateSdkTs = async () => {
try {
execSync('npx prettier -w sdk.d.ts');
} catch (error) {
console.log(
process.stdout.write(
`Error ${error.status} executing Prettier` +
` to prettify SDK TS definitions: '${error.message}'`,
);
Expand Down

0 comments on commit 904bfc9

Please sign in to comment.