Skip to content

Commit

Permalink
fixed bugs with npm pkg version analysis error
Browse files Browse the repository at this point in the history
  • Loading branch information
mizi-lin committed Aug 16, 2018
1 parent c2a79b1 commit b07ce43
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 2 additions & 2 deletions service/upgrade.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ const getWaitPkgs = function(pkgs, defPkgPath) {
if(fs.existsSync(path)) {
let pkg = $util.loadJSON(path);
let ver = pkg.version;
version = $util.getVersion(_.trim(version));
ver = $util.getVersion(_.trim(ver));
version = _.trim(version);
ver = _.trim(ver);

// 只要本地版本与mri提供版本不一样
// 本地包就必须重装
Expand Down
4 changes: 0 additions & 4 deletions service/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,6 @@ module.exports = {
return require(path);
},

getVersion(version) {
return version.replace(/^.*?([0-9.\-b]*)$/g, '$1');
},

/**
* 批量创建文件
* @param arr
Expand Down

0 comments on commit b07ce43

Please sign in to comment.