mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
refactor(cloudcmd) showUpdateInfo: early return
This commit is contained in:
parent
b965ae338c
commit
c731f706f8
1 changed files with 15 additions and 14 deletions
|
|
@ -251,19 +251,20 @@ function checkUpdate() {
|
|||
function showUpdateInfo(data) {
|
||||
const version = data.version;
|
||||
|
||||
if (version !== Info.version) {
|
||||
const chalk = require('chalk');
|
||||
const rendy = require('rendy');
|
||||
|
||||
const latest = rendy('update available: {{ latest }}', {
|
||||
latest: chalk.green.bold('v' + version),
|
||||
});
|
||||
|
||||
const current = chalk.dim(rendy('(current: v{{ current }})', {
|
||||
current: Info.version
|
||||
}));
|
||||
|
||||
console.log('%s %s', latest, current);
|
||||
}
|
||||
if (version === Info.version)
|
||||
return;
|
||||
|
||||
const chalk = require('chalk');
|
||||
const rendy = require('rendy');
|
||||
|
||||
const latest = rendy('update available: {{ latest }}', {
|
||||
latest: chalk.green.bold('v' + version),
|
||||
});
|
||||
|
||||
const current = chalk.dim(rendy('(current: v{{ current }})', {
|
||||
current: Info.version
|
||||
}));
|
||||
|
||||
console.log('%s %s', latest, current);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue