Skip to content

Commit

Permalink
fix: new version notice when updated
Browse files Browse the repository at this point in the history
  • Loading branch information
Sukwants committed Aug 19, 2023
1 parent 4340658 commit 7e1ea41
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ async function update() { // Manually update
} else {
try {
execSync('npm update -g atiro', { stdio: 'inherit' });
exit({ noticeNewVersion: false });
} catch (error) {
console.log(chalk.green('[Error]', 'Something went wrong when updating.'));
}
Expand Down
4 changes: 2 additions & 2 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ function start() {
produced.load();
}

function exit() {
if (config.getValue('update', 'type') != 'ignore') {
function exit(options) {
if ((options && (options.noticeNewVersion == undefined || options.noticeNewVersion)) && config.getValue('update', 'type') != 'ignore') {
const latest = produced.getValue('update', 'latest_version');
if (latest && semver.gt(latest, require('../package.json').version)) {
console.log(chalk.blue('[Notice]'), `A new version ${latest} detected. Run \`${require('../package.json').name} update\` to update!`);
Expand Down

0 comments on commit 7e1ea41

Please sign in to comment.