-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
fusheng
committed
Feb 25, 2018
1 parent
9108e5f
commit 8707153
Showing
5 changed files
with
29 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,20 @@ | ||
let fetch = require('node-fetch') | ||
let localV = require('../package').version | ||
let log = require('../utils/utils').log | ||
let utils = require('../utils/utils') | ||
let localV = utils.getVer() | ||
let log = utils.log | ||
let child_process = require('child_process'); | ||
|
||
(async function(){ | ||
(async function () { | ||
// search on npm | ||
let res = await fetch('https://registry.npmjs.com/@linhun%2Fjane-cli').then(res => res.json()) | ||
let onlineV = res['dist-tags'].latest | ||
// diff | ||
if(localV < onlineV){ | ||
if (localV < onlineV) { | ||
log.info(`线上最新为${onlineV},升级中...`) | ||
log.info(`请输入密码,赋予读写权限`) | ||
child_process.execSync("sudo npm install @linhun/jane-cli -g",{stdio:[0,1,2]}) | ||
child_process.execSync("sudo npm install @linhun/jane-cli -g", {stdio: [0, 1, 2]}) | ||
} | ||
else{ | ||
else { | ||
log.info('已是最新版') | ||
} | ||
})() |
Empty file.