@wjwjq/release-helper 0.2.3 → 0.2.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.
Files changed (2) hide show
  1. package/dist/publish.js +11 -4
  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
- const res = await execa(`git remote -v `).pipe(` sed -n '1p'`).pipe(`awk -F ' ' '{print $2}'`).pipe(`sed -e 's/.git//'`);
26
- const repo = res.stdout.replace("\n", "");
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 {
@@ -133,14 +139,15 @@ async function getGitTags() {
133
139
  }
134
140
  async function selectLatestTag(targetVersion) {
135
141
  let latestTag = "";
136
- const tags = await getGitTags();
142
+ let tags = await getGitTags();
143
+ tags = tags.filter((item) => item !== targetVersion);
137
144
  if (tags.length >= 2) {
138
145
  const ac = new AbortController();
139
146
  const prompt = inquirer.select(
140
147
  {
141
148
  message: "\u8BF7\u9009\u62E9\u53D1\u5E03\u4FE1\u606F\u4ECE\u54EA\u6B21tag\u5F00\u59CB\u751F\u6210\uFF0C\uFF08\u9ED8\u8BA4\uFF1A \u6700\u8FD1\u4E00\u6B21\uFF0C\u7279\u522B\u9488\u5BF9\u67D0\u4E3B\u7248\u672C\u4E4B\u95F4\u6709\u5C0F\u7248\u672C\u8FC7\u6E21\u7684\u60C5\u51B5\uFF09(timing out in 10 seconds)\uFF1A",
142
149
  default: tags[0],
143
- choices: tags.filter((item) => item !== targetVersion).map((tag) => ({ value: tag }))
150
+ choices: tags.map((tag) => ({ value: tag }))
144
151
  }
145
152
  );
146
153
  prompt.finally(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wjwjq/release-helper",
3
- "version": "0.2.3",
3
+ "version": "0.2.5",
4
4
  "description": "generate deployment package for frontend, include nginx...",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",