From c731f706f8d16db022fa1fc31c77b8cea1c28e4c Mon Sep 17 00:00:00 2001 From: coderaiser Date: Sat, 18 Aug 2018 22:26:11 +0300 Subject: [PATCH] refactor(cloudcmd) showUpdateInfo: early return --- bin/cloudcmd.js | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/bin/cloudcmd.js b/bin/cloudcmd.js index 9ad2cc60..a5e9da42 100755 --- a/bin/cloudcmd.js +++ b/bin/cloudcmd.js @@ -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); }