cloudcc-cli 1.7.3 → 1.7.4

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/README.md CHANGED
@@ -1,3 +1,11 @@
1
+ # ReleaseV1.7.4
2
+ #### 发布日期:2025-1-7
3
+ #### 发布范围:全量
4
+ #### 发布内容
5
+ * 优化
6
+ * 调整日期时间格式
7
+
8
+
1
9
  # ReleaseV1.7.3
2
10
  #### 发布日期:2025-1-7
3
11
  #### 发布范围:全量
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloudcc-cli",
3
- "version": "1.7.3",
3
+ "version": "1.7.4",
4
4
  "description": "cloudcc-cli",
5
5
  "keywords": [
6
6
  "cloudcc",
@@ -1,4 +1,3 @@
1
-
2
1
  const config = require("../package.json")
3
2
  const inquirer = require("inquirer")
4
3
  const exec = require('child_process').execSync;
@@ -10,33 +9,29 @@ function checkNpmVersion() {
10
9
  let onlineVersionNum
11
10
  let onlineVersion = '0.0.1'
12
11
 
13
-
12
+ // 获取在线版本
14
13
  onlineVersion = exec(`npm view cloudcc-cli version --registry http://registry.npmmirror.com`)
15
14
  onlineVersion = onlineVersion.toString("utf8").trim();
16
15
 
17
-
18
-
19
-
20
-
21
-
22
-
16
+ // 获取发布时间信息
17
+ const timeInfo = exec(`npm view cloudcc-cli time --json --registry http://registry.npmmirror.com`)
18
+ const timeData = JSON.parse(timeInfo.toString().trim());
19
+ const formattedTime = new Date(timeData[onlineVersion]).toLocaleString('zh-CN', {
20
+ year: 'numeric',
21
+ month: '2-digit',
22
+ day: '2-digit'
23
+ });
24
+
23
25
  onlineVersionNum = Number(onlineVersion.replace(/\./g, ""));
24
26
 
25
- console.log(chalk.green(
26
- `
27
- ********************************************************************************
28
- * *
29
- * CloudCC CLI *
30
- * *
31
- * Current Version:V${config.version} *
32
- * Latest Version:V${onlineVersion} *
33
- * *
34
- * *
35
- ********************************************************************************
36
- `
37
- ))
38
-
39
-
27
+ console.log('\n');
28
+ console.log(chalk.bold.cyan(' CloudCC CLI Version\n'));
29
+ console.log(' ' + chalk.gray('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'));
30
+ console.log(' ' + chalk.green('★') + ' Current Version : ' + chalk.bold.green('v' + config.version));
31
+ console.log(' ' + chalk.blue('★') + ' Latest Version : ' + chalk.bold.blue('v' + onlineVersion));
32
+ console.log(' ' + chalk.yellow('★') + ' Published At : ' + chalk.gray(formattedTime));
33
+ console.log(' ' + chalk.gray('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n'));
34
+
40
35
  if (onlineVersionNum - currentVersion > 0) {
41
36
  return onlineVersion;
42
37
  }
@@ -85,6 +80,7 @@ async function checkUpdate() {
85
80
  return true;
86
81
  } else {
87
82
  return false
83
+
88
84
  }
89
85
  }
90
86
  return false