Improved error message for yarn dev

refs https://github.com/TryGhost/DevOps/issues/104

- added colors and better messages to help when the script fails
This commit is contained in:
Daniel Lockyer 2023-11-15 10:23:57 +01:00 committed by Daniel Lockyer
parent 14741b1521
commit 199baacfd5

View File

@ -214,6 +214,10 @@ async function handleStripe() {
try {
await result;
} catch (err) {
console.error('\nExecuting dev command failed, ensure dependencies are up-to-date by running `yarn fix`\n');
console.error();
console.error(chalk.red(`Executing dev command failed:`) + `\n`);
console.error(chalk.red(`If you've recently done a \`yarn main\`, dependencies might be out of sync. Try running \`${chalk.green('yarn fix')}\` to fix this.`));
console.error(chalk.red(`If not, something else went wrong. Please report this to the Ghost team.`));
console.error();
}
})();