Skip to content

Commit

Permalink
feat: add disable-check params
Browse files Browse the repository at this point in the history
  • Loading branch information
cpselvis committed Dec 15, 2018
1 parent 4e6da68 commit d6542ad
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lib/core/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const osenv = require('osenv');
const Promise = require('bluebird');
const chalk = require('chalk');
const fs = require('hexo-fs');
const { camelizeKeys } = require('humps');
const logger = require('./logger');
const Command = require('./command');
const utils = require('../utils');
Expand Down Expand Up @@ -43,6 +44,8 @@ class Feflow {
silent: Boolean(args.silent)
});

this.args = camelizeKeys(args);

this.cmd = new Command();
}

Expand Down
8 changes: 7 additions & 1 deletion lib/core/upgrade.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,16 @@ class Upgrade {

checkCore() {
const self = this;
const { config, log } = this.ctx;
const { config, log, args } = this.ctx;
const registry = config && config.registry;

log.debug('正在检查cli core更新...');

if (args.disableCheck) {
log.debug('用户禁用了cli core得更新检查');
return;
}

return pkgJson('feflow-cli', 'latest', registry).then(json => {
const version = pkg.version;
const configs = json.configs;
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"figlet": "^1.2.0",
"fs-extra": "^7.0.0",
"hexo-fs": "^0.2.1",
"humps": "^2.0.1",
"inquirer": "^3.0.6",
"js-yaml": "^3.9.1",
"meow": "^3.7.0",
Expand Down

0 comments on commit d6542ad

Please sign in to comment.