ljr-cli 1.0.5 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/index.js +5 -4
- package/package.json +1 -1
package/bin/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
1
|
+
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import { program } from "commander"
|
|
4
4
|
import gradient from "gradient-string"
|
|
@@ -35,10 +35,11 @@ const __dirname = path.dirname(__filename)
|
|
|
35
35
|
const pkg = JSON.parse(readFileSync(path.join(__dirname, "../package.json"), "utf-8"))
|
|
36
36
|
const version = pkg.version
|
|
37
37
|
|
|
38
|
-
const notifier = updateNotifier({ pkg
|
|
39
|
-
//
|
|
40
|
-
|
|
38
|
+
// const notifier = updateNotifier({ pkg })
|
|
39
|
+
// TAG:update-notifier 会把检查结果缓存(默认间隔 1 天),短时间内不会再次提示,updateCheckInterval: 0 表示每次都检查(演示的时候放开注释)
|
|
40
|
+
const notifier = updateNotifier({ pkg, updateCheckInterval: 0 })
|
|
41
41
|
|
|
42
|
+
// 如果有更新
|
|
42
43
|
if (notifier.update && notifier.update.latest && notifier.update.latest !== pkg.version) {
|
|
43
44
|
notifier.notify()
|
|
44
45
|
}
|