Open karanshah-browserstack opened 3 years ago
I also want to know how to add a link to the change log.
Like npm does it:
╭───────────────────────────────────────────────────────────────╮
│ │
│ New major version of npm available! 6.14.15 → 8.3.0 │
│ Changelog: https://github.com/npm/cli/releases/tag/v8.3.0 │
│ Run npm install -g npm to update! │
│ │
╰───────────────────────────────────────────────────────────────╯
It will be good to have it as a property, but actually you can do it using the custom message option:
https://github.com/yeoman/update-notifier#options-and-custom-message
If that's any useful, I am now using the following custom message
based on this thread and https://github.com/yeoman/update-notifier/blob/main/update-notifier.js#L152-L156:
if (notifier.update) {
notifier.notify({
message: `New ${notifier.update.type} version available: ${chalk.dim(
'{currentVersion}',
)}${chalk.reset(' → ')}${
notifier.update.type === 'major' ? chalk.red('{latestVersion}')
: notifier.update.type === 'minor' ? chalk.yellow('{latestVersion}')
: chalk.green('{latestVersion}')
}\n` +
`Run ${chalk.cyan('{updateCommand}')} to update\n` +
'${chalk.dim.underline(`${packageJson.homepage ?? ''}/releases`)}`,
});
}
Result:
I would love for this to be the default! Or at the very least be able to append to the default template without having to re-specify it entirely!
@equiman Use https://github.com/sindresorhus/terminal-link
Add a option to add ChangeLog message in default message. Example :