cloudcc-cli 1.4.6 → 1.4.7
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 +7 -0
- package/package.json +1 -1
- package/src/publishProjectH5.js +6 -13
package/README.md
CHANGED
package/package.json
CHANGED
package/src/publishProjectH5.js
CHANGED
|
@@ -123,7 +123,7 @@ class Publish {
|
|
|
123
123
|
|
|
124
124
|
try {
|
|
125
125
|
// 6:写入版本信息
|
|
126
|
-
this.writeVersion(version, outPath);
|
|
126
|
+
this.writeVersion(version, outPath, condition.type);
|
|
127
127
|
} catch (error) {
|
|
128
128
|
console.log(chalk.red("版本信息写入异常:" + error))
|
|
129
129
|
}
|
|
@@ -166,22 +166,15 @@ class Publish {
|
|
|
166
166
|
})
|
|
167
167
|
}
|
|
168
168
|
/**
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
writeVersion(version, outPath
|
|
169
|
+
* 将版本信息写入文件
|
|
170
|
+
* @param {版本信息} version
|
|
171
|
+
* @param {输出路径} outPath
|
|
172
|
+
*/
|
|
173
|
+
writeVersion(version, outPath, type) {
|
|
174
174
|
try {
|
|
175
175
|
// 获得分支信息
|
|
176
176
|
let branch = execSync('git branch --show-current');
|
|
177
177
|
branch = branch.toString("utf8").trim();
|
|
178
|
-
// 获得提交版本信息
|
|
179
|
-
var gitHEAD = fs.readFileSync('.git/HEAD', 'utf-8').trim()
|
|
180
|
-
var ref = gitHEAD.split(': ')[1]
|
|
181
|
-
var develop = gitHEAD.split('/')[2]
|
|
182
|
-
var gitVersion = fs.readFileSync('.git/' + ref, 'utf-8').trim()
|
|
183
|
-
var gitCommitVersion = '"' + develop + ': ' + gitVersion + '"'
|
|
184
|
-
|
|
185
178
|
let versionInfo =
|
|
186
179
|
`
|
|
187
180
|
<!DOCTYPE html>
|