@wjwjq/release-helper 0.2.2 → 0.2.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/dist/publish.js +9 -3
- package/dist/release.js +2 -2
- package/package.json +1 -1
package/dist/publish.js
CHANGED
|
@@ -22,8 +22,14 @@ async function isGitFlowRepo() {
|
|
|
22
22
|
return false;
|
|
23
23
|
}
|
|
24
24
|
async function getRepo() {
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
let repo;
|
|
26
|
+
try {
|
|
27
|
+
const res = await execa(`git remote -v `).pipe(` sed -n '1p'`).pipe(`awk -F ' ' '{print $2}'`).pipe(`sed -e 's/.git//'`);
|
|
28
|
+
repo = res.stdout.replace("\n", "");
|
|
29
|
+
} catch (error) {
|
|
30
|
+
const res = await $`git remote -v`;
|
|
31
|
+
repo = res.stdout.split("\n")[1].split(" ")[0].split(" ")[1].replace(".git", "").replace("\n", "");
|
|
32
|
+
}
|
|
27
33
|
if (repo.startsWith("git@")) {
|
|
28
34
|
const ps2 = repo.split("/");
|
|
29
35
|
return {
|
|
@@ -63,7 +69,7 @@ async function getChangeLog(host, newVersion, userSelectedLatestTag, markdownUrl
|
|
|
63
69
|
}
|
|
64
70
|
}
|
|
65
71
|
let logCmd = `git log ${tagRange} --format=%B%H----DELIMITER---- --abbrev-commit`;
|
|
66
|
-
const { stdout: r } = await
|
|
72
|
+
const { stdout: r } = await $`${logCmd}`;
|
|
67
73
|
output2 = r;
|
|
68
74
|
} catch (error) {
|
|
69
75
|
console.error("\u{1F680} ~ getLog ~ error:", error);
|
package/dist/release.js
CHANGED
|
@@ -20,7 +20,7 @@ async function release(fromPublishCmd = false) {
|
|
|
20
20
|
try {
|
|
21
21
|
await checkEnvInfo();
|
|
22
22
|
await hasUncommittedChanges();
|
|
23
|
-
let { stdout: originalBranch } = await
|
|
23
|
+
let { stdout: originalBranch } = await $`git branch --show-current`;
|
|
24
24
|
let version = await inquirer.input({
|
|
25
25
|
message: "\u8BF7\u8F93\u5165\u7248\u672C\u53F7\uFF1A"
|
|
26
26
|
});
|
|
@@ -93,7 +93,7 @@ async function doGitFlowRelease(version) {
|
|
|
93
93
|
logger.error("\u5F53\u524D\u4ED3\u5E93 \u975Egit flow\u4ED3\u5E93\uFF0C\u8BF7\u4F7F\u7528git flow init \u521D\u59CB\u5316\u540E\uFF0C\u518D\u6267\u884C\u6B64\u547D\u4EE4");
|
|
94
94
|
process.exit(1);
|
|
95
95
|
}
|
|
96
|
-
let { stdout: currentBranch } = await
|
|
96
|
+
let { stdout: currentBranch } = await $`git branch --show-current`;
|
|
97
97
|
const releaseBranch = `release/${version}`;
|
|
98
98
|
if (currentBranch !== "develop" && currentBranch !== releaseBranch) {
|
|
99
99
|
const { stdout } = await $`git branch -a`;
|