cloudcc-cli 0.8.5 → 0.8.6
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/publishProject.js +3 -0
- package/utils/pushCode.js +7 -4
package/README.md
CHANGED
package/package.json
CHANGED
package/src/publishProject.js
CHANGED
|
@@ -34,6 +34,9 @@ class Publish {
|
|
|
34
34
|
let condition = await askType();
|
|
35
35
|
// 获得version
|
|
36
36
|
let version = getNewVersionName([condition.type])
|
|
37
|
+
console.log();
|
|
38
|
+
console.log(chalk.green('待发布版本:' + version));
|
|
39
|
+
console.log();
|
|
37
40
|
if (await this.build()) {
|
|
38
41
|
// 将readme生成为html,并复制到dist中
|
|
39
42
|
let outPath = "dist"
|
package/utils/pushCode.js
CHANGED
|
@@ -102,13 +102,18 @@ function getNewVersionName(types) {
|
|
|
102
102
|
exec("git fetch --tags -f")
|
|
103
103
|
return types.map((item) => {
|
|
104
104
|
// 更新本地tag
|
|
105
|
-
let version = exec(`git
|
|
105
|
+
let version = exec(`git tag --sort=-committerdate`)
|
|
106
106
|
version = version.toString("utf8").trim();
|
|
107
107
|
if (version) {
|
|
108
|
+
// 获取第一个版本号
|
|
109
|
+
version = version.split("\n")[0]
|
|
110
|
+
console.log("version 1", version);
|
|
108
111
|
// 取版本号
|
|
109
112
|
version = version.split("-V")[1]
|
|
113
|
+
console.log("version 2", version);
|
|
110
114
|
// 改变版本号
|
|
111
115
|
version = changeVersion.change(version, item)
|
|
116
|
+
console.log("version 3", version);
|
|
112
117
|
// 生成最后的版本号
|
|
113
118
|
item = item + "-V" + version
|
|
114
119
|
} else {
|
|
@@ -124,9 +129,7 @@ function getNewVersionName(types) {
|
|
|
124
129
|
*/
|
|
125
130
|
function pushCodeAndTags(types = []) {
|
|
126
131
|
let versions = getNewVersionName(types);
|
|
127
|
-
|
|
128
|
-
console.log(chalk.green('待发布版本:' + versions));
|
|
129
|
-
console.log();
|
|
132
|
+
|
|
130
133
|
return push(versions[0]) && setTag(types, versions)
|
|
131
134
|
}
|
|
132
135
|
module.exports = { pushCodeAndTags, push, getNewVersionName, setTag }
|