@wjwjq/release-helper 0.2.3 → 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.
Files changed (2) hide show
  1. package/dist/publish.js +8 -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
- 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 {
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.4",
4
4
  "description": "generate deployment package for frontend, include nginx...",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",