fix: 🐛 Fix incorrect docs, make exit code 0 instead of 1

This commit is contained in:
Jesse Wierzbinski 2024-06-13 23:26:20 -10:00
parent 641e712272
commit edbe6e45b2
No known key found for this signature in database
6 changed files with 20 additions and 17 deletions

View file

@ -6,6 +6,7 @@
*/
import { loadConfig, watchConfig } from "c12";
import { fromZodError } from "zod-validation-error";
import { type Config, configValidator } from "./config.type";
const { config } = await watchConfig({
@ -21,7 +22,9 @@ const { config } = await watchConfig({
const parsed = await configValidator.safeParseAsync(config);
if (!parsed.success) {
process.exit(1);
console.error("Invalid config file:");
console.error(fromZodError(parsed.error).message);
process.exit();
}
const exportedConfig = parsed.data;