cloudcc-cli 1.5.4 → 1.5.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.
package/README.md CHANGED
@@ -1,9 +1,16 @@
1
+ # ReleaseV1.5.5
2
+ #### 发布日期:2023-12-26
3
+ #### 发布范围:全量
4
+ #### 发布内容
5
+ * 修复
6
+ * 普通命令打包。
7
+
1
8
  # ReleaseV1.5.4
2
- #### 发布日期:2023-11-21
9
+ #### 发布日期:2023-12-25
3
10
  #### 发布范围:全量
4
11
  #### 发布内容
5
12
  * 迭代
6
- * 更改打包框架
13
+ * 添加build2命令。
7
14
 
8
15
  # ReleaseV1.5.3
9
16
  #### 发布日期:2023-11-21
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env node
1
+ #!/usr/bin/env node
2
2
 
3
3
  const Builder = require("../src/builderCreate.js");
4
4
 
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env node
1
+ #!/usr/bin/env node
2
2
 
3
3
  const Publish = require("../src/publishProjectBuild.js");
4
4
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloudcc-cli",
3
- "version": "1.5.4",
3
+ "version": "1.5.5",
4
4
  "description": "cloudcc-cli",
5
5
  "keywords": [
6
6
  "cloudcc",
@@ -102,50 +102,8 @@ class Publish {
102
102
  }
103
103
  }
104
104
  // 4:开始打包
105
- if (["Stable", "Latest", "GA"].includes(condition.type)) {
106
- this.buildStable(condition)
107
- } else {
108
- this.build(condition)
109
- }
110
- }
111
- }
112
-
113
- /**
114
- * 编译代码
115
- * @param {发布类型} types:Stable/Latest/GA
116
- * @returns
117
- */
118
- buildStable(condition) {
119
- console.log(chalk.green('开始编译,请稍后...'));
120
- console.log();
121
- // 5:获取新的发布版本号
122
- let version = getNewVersionName([condition.type])
123
- // 5.1:将版本信息写入env文件中,公其他业务使用
124
- try {
125
- fs.writeFileSync(".env.production", "VUE_APP_PROJECT_VERSION = " + condition.type + "-" + version, 'utf-8')
126
- } catch (error) {
105
+ this.build(condition)
127
106
  }
128
- let that = this;
129
- // 打包命令
130
- exec('npm run build', (error, stdout, stderr) => {
131
- if (error) {
132
- exec('npx vue-cli-service build', (error, stdout, stderr) => {
133
- if (error) {
134
- console.log('编译失败:', error);
135
- console.log(chalk.red('编译失败:' + stdout));
136
- } else {
137
- console.log(chalk.green('编译成功!'));
138
- console.log();
139
- that.buildSucess(condition, version);
140
- }
141
- })
142
- } else {
143
- console.log(chalk.green('编译成功!'));
144
- console.log();
145
- that.buildSucess(condition, version);
146
- }
147
- })
148
-
149
107
  }
150
108
 
151
109
  /**
@@ -227,7 +185,7 @@ class Publish {
227
185
  })
228
186
  fs.writeFileSync("README.md", data)
229
187
  // 6:将readme生成为html,并复制到dist中
230
- let outPath = ["Stable", "Latest", "GA"].includes(condition.type) ? "build/dist" : "dist"
188
+ let outPath = "dist"
231
189
  // 读取配置,是否改变了输出路径
232
190
  if (projectConfig.config && projectConfig.config["doc-path"]) {
233
191
  outPath = projectConfig.config["doc-path"];
package/utils/pushCode.js CHANGED
@@ -49,7 +49,9 @@ function push(version, update = "0", path) {
49
49
  try {
50
50
  // 添加改变文件
51
51
  exec(`git -C ${path} add .`)
52
- exec(`git add .`)
52
+ if ("." != path) {
53
+ exec(`git add .`)
54
+ }
53
55
  } catch (error) {
54
56
  return false;
55
57
  }
@@ -57,7 +59,9 @@ function push(version, update = "0", path) {
57
59
  try {
58
60
  // 提交到本地
59
61
  exec(`git -C ${path} commit -m ` + version)
60
- exec(`git commit -m ` + version)
62
+ if ("." != path) {
63
+ exec(`git commit -m ` + version)
64
+ }
61
65
  } catch (error) {
62
66
  return false;
63
67
  }
@@ -67,14 +71,18 @@ function push(version, update = "0", path) {
67
71
  try {
68
72
  // 推送到服务器
69
73
  exec(`git -C ${path} push`)
70
- exec(`git push`)
74
+ if ("." != path) {
75
+ exec(`git push`)
76
+ }
71
77
  console.log();
72
78
  console.log(chalk.green('代码推送成功!'));
73
79
  } catch (error) {
74
80
  console.log("update", update);
75
81
  if ("1" == update) {
76
82
  exec(`git -C ${path} fetch --tags -f && git -C ${path} pull --force && git -C ${path} push`)
77
- exec(`git fetch --tags -f && git pull --force && git push`)
83
+ if ("." != path) {
84
+ exec(`git fetch --tags -f && git pull --force && git push`)
85
+ }
78
86
  console.log(chalk.green('代码推送成功!'));
79
87
  } else {
80
88
  console.log(chalk.red('代码推送失败,本地代码与线上不同步,请先 git pull 同步!'));