Skip to content

Commit 59b5807

Browse files
authored
🐛 fix(cli): use 'gray' instead of 'grey' in styleText calls (jackyzha0#2321)
Node.js util.styleText does not accept 'grey' as a format name. While util.inspect.colors defines 'grey' as a non-enumerable alias for 'gray', styleText validates against Object.keys(inspect.colors) which only includes enumerable properties — so 'grey' has never been a valid styleText format and throws ERR_INVALID_ARG_VALUE.
1 parent 9576701 commit 59b5807

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

quartz/cli/handlers.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ export async function handleBuild(argv) {
318318

319319
const result = await ctx.rebuild().catch((err) => {
320320
console.error(`${styleText("red", "Couldn't parse Quartz configuration:")} ${fp}`)
321-
console.log(`Reason: ${styleText("grey", err)}`)
321+
console.log(`Reason: ${styleText("gray", err)}`)
322322
process.exit(1)
323323
})
324324
release()
@@ -395,7 +395,7 @@ export async function handleBuild(argv) {
395395
status >= 200 && status < 300
396396
? styleText("green", `[${status}]`)
397397
: styleText("red", `[${status}]`)
398-
console.log(statusString + styleText("grey", ` ${argv.baseDir}${req.url}`))
398+
console.log(statusString + styleText("gray", ` ${argv.baseDir}${req.url}`))
399399
release()
400400
}
401401

@@ -406,7 +406,7 @@ export async function handleBuild(argv) {
406406
})
407407
console.log(
408408
styleText("yellow", "[302]") +
409-
styleText("grey", ` ${argv.baseDir}${req.url} -> ${newFp}`),
409+
styleText("gray", ` ${argv.baseDir}${req.url} -> ${newFp}`),
410410
)
411411
res.end()
412412
}
@@ -482,7 +482,7 @@ export async function handleBuild(argv) {
482482
.on("change", () => build(clientRefresh))
483483
.on("unlink", () => build(clientRefresh))
484484

485-
console.log(styleText("grey", "hint: exit with ctrl+c"))
485+
console.log(styleText("gray", "hint: exit with ctrl+c"))
486486
}
487487
}
488488

0 commit comments

Comments
 (0)