cloudcc-cli 1.3.7 → 1.3.8
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 +8 -0
- package/package.json +1 -1
- package/src/publishProject.js +38 -36
- package/utils/changeVersion.js +2 -0
package/README.md
CHANGED
package/package.json
CHANGED
package/src/publishProject.js
CHANGED
|
@@ -103,6 +103,44 @@ class Publish {
|
|
|
103
103
|
this.build(condition)
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* 编译代码
|
|
109
|
+
* @param {发布类型} types:Dev,uat,Release,GA,RC
|
|
110
|
+
* @returns
|
|
111
|
+
*/
|
|
112
|
+
build(condition) {
|
|
113
|
+
console.log(chalk.green('开始编译,请稍后...'));
|
|
114
|
+
console.log();
|
|
115
|
+
// 5:获取新的发布版本号
|
|
116
|
+
let version = getNewVersionName([condition.type])
|
|
117
|
+
// 5.1:将版本信息写入env文件中,公其他业务使用
|
|
118
|
+
try {
|
|
119
|
+
fs.writeFileSync(".env.production", "VUE_APP_PROJECT_VERSION = " + condition.type + "-" + version, 'utf-8')
|
|
120
|
+
} catch (error) {
|
|
121
|
+
}
|
|
122
|
+
let that = this;
|
|
123
|
+
// 打包命令
|
|
124
|
+
exec('npm run build', (error, stdout, stderr) => {
|
|
125
|
+
if (error) {
|
|
126
|
+
exec('npx vue-cli-service build', (error, stdout, stderr) => {
|
|
127
|
+
if (error) {
|
|
128
|
+
console.log('编译失败:', error);
|
|
129
|
+
console.log(chalk.red('编译失败:' + stdout));
|
|
130
|
+
} else {
|
|
131
|
+
console.log(chalk.green('编译成功!'));
|
|
132
|
+
console.log();
|
|
133
|
+
that.buildSucess(condition, version);
|
|
134
|
+
}
|
|
135
|
+
})
|
|
136
|
+
} else {
|
|
137
|
+
console.log(chalk.green('编译成功!'));
|
|
138
|
+
console.log();
|
|
139
|
+
that.buildSucess(condition, version);
|
|
140
|
+
}
|
|
141
|
+
})
|
|
142
|
+
|
|
143
|
+
}
|
|
106
144
|
/**
|
|
107
145
|
* 编译成功回调
|
|
108
146
|
*/
|
|
@@ -174,43 +212,7 @@ class Publish {
|
|
|
174
212
|
console.log();
|
|
175
213
|
}
|
|
176
214
|
}
|
|
177
|
-
/**
|
|
178
|
-
* 编译代码
|
|
179
|
-
* @param {发布类型} types:Dev,uat,Release,GA,RC
|
|
180
|
-
* @returns
|
|
181
|
-
*/
|
|
182
|
-
build(condition) {
|
|
183
|
-
console.log(chalk.green('开始编译,请稍后...'));
|
|
184
|
-
console.log();
|
|
185
|
-
// 5:获取新的发布版本号
|
|
186
|
-
let version = getNewVersionName([condition.type])
|
|
187
|
-
// 5.1:将版本信息写入env文件中,公其他业务使用
|
|
188
|
-
try {
|
|
189
|
-
fs.writeFileSync(".env.production", "VUE_APP_PROJECT_VERSION = " + condition.type + "-" + version, 'utf-8')
|
|
190
|
-
} catch (error) {
|
|
191
|
-
}
|
|
192
|
-
let that = this;
|
|
193
|
-
// 打包命令
|
|
194
|
-
exec('npm run build', (error, stdout, stderr) => {
|
|
195
|
-
if (error) {
|
|
196
|
-
exec('npx vue-cli-service build', (error, stdout, stderr) => {
|
|
197
|
-
if (error) {
|
|
198
|
-
console.log('编译失败:', error);
|
|
199
|
-
console.log(chalk.red('编译失败:' + stdout));
|
|
200
|
-
} else {
|
|
201
|
-
console.log(chalk.green('编译成功!'));
|
|
202
|
-
console.log();
|
|
203
|
-
that.buildSucess(condition, version);
|
|
204
|
-
}
|
|
205
|
-
})
|
|
206
|
-
} else {
|
|
207
|
-
console.log(chalk.green('编译成功!'));
|
|
208
|
-
console.log();
|
|
209
|
-
that.buildSucess(condition, version);
|
|
210
|
-
}
|
|
211
|
-
})
|
|
212
215
|
|
|
213
|
-
}
|
|
214
216
|
/**
|
|
215
217
|
* 将版本信息写入文件
|
|
216
218
|
* @param {版本信息} version
|
package/utils/changeVersion.js
CHANGED
|
@@ -19,6 +19,8 @@ function change(version, type) {
|
|
|
19
19
|
ret = split[0] + "." + (++split[1]) + "." + split[2];
|
|
20
20
|
} else if (updateLast.includes(type)) {
|
|
21
21
|
ret = split[0] + "." + split[1] + "." + (++split[2]);
|
|
22
|
+
} else {
|
|
23
|
+
ret = split[0] + "." + split[1] + "." + (++split[2]);
|
|
22
24
|
}
|
|
23
25
|
}
|
|
24
26
|
return ret;
|