cloudcc-cli 1.2.0 → 1.2.2

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.
@@ -13,6 +13,7 @@
13
13
  },
14
14
  "dependencies": {
15
15
  "axios": "^0.21.1",
16
+ "cloudcc-ccdk": "0.0.9",
16
17
  "core-js": "^3.6.5",
17
18
  "vue": "^2.6.11",
18
19
  "vue-cookies": "^1.7.4",
@@ -8,9 +8,20 @@ const chalk = require("chalk")
8
8
  */
9
9
  function checkNpmVersion() {
10
10
  let currentVersion = Number(config.version.replace(/\./g, ""));
11
- let onlineVersion = exec(`npm view cloudcc-cli version --registry http://registry.npmjs.org`)
12
- onlineVersion = onlineVersion.toString("utf8").trim();
13
- let onlineVersionNum = Number(onlineVersion.replace(/\./g, ""))
11
+ let onlineVersionNum
12
+ let onlineVersion = '0.0.1'
13
+
14
+ // 从npm官网获取版本号
15
+ // onlineVersion = exec(`npm view cloudcc-cli version --registry http://registry.npmjs.org`)
16
+ // onlineVersion = onlineVersion.toString("utf8").trim();
17
+
18
+ // 从阿里源获取版本号
19
+ try {
20
+ onlineVersion = exec(`curl -s http://www.npmmirror.com/package/cloudcc-cli`)
21
+ onlineVersion = onlineVersion.toString("utf8").trim().split('img title="')[1].split('" src')[0];
22
+ } catch (e) {
23
+ }
24
+ onlineVersionNum = Number(onlineVersion.replace(/\./g, ""));
14
25
  // 如果结果大于0,那么提示升级
15
26
  if (onlineVersionNum - currentVersion > 0) {
16
27
  console.log();
package/utils/test.js CHANGED
@@ -1,4 +1,2 @@
1
- version = "Release-V12.3.2"
2
- version = version.split("\n")[0]
3
- version = version.split("-V")[1]
4
- console.log("Release-V12.3.2",version);
1
+ const fs = require('fs')
2
+ const exec = require('child_process').execSync;