ljr-cli 1.0.3 → 1.0.5

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.
Files changed (2) hide show
  1. package/bin/index.js +9 -2
  2. 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"
@@ -34,7 +34,14 @@ const __filename = fileURLToPath(import.meta.url)
34
34
  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
- updateNotifier({ pkg: pkg }).notify()
37
+
38
+ const notifier = updateNotifier({ pkg, updateCheckInterval: 0 }) // 0 表示每次都检查
39
+ // 打印调试信息(看 notifier.update)
40
+ console.log("update-notifier debug:", notifier.update)
41
+
42
+ if (notifier.update && notifier.update.latest && notifier.update.latest !== pkg.version) {
43
+ notifier.notify()
44
+ }
38
45
 
39
46
  // 当前命令行的路径
40
47
  const cwdPath = process.cwd()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ljr-cli",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "type": "module",