@jswork/ushell-module-git 1.0.25 → 1.0.27

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/modules/09-oprr.sh +10 -2
  2. package/package.json +1 -1
@@ -1,8 +1,16 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
-
4
3
  # 如果提供了参数,使用参数;否则使用 'dev' 作为默认值
5
4
  BASE_BRANCH=${1:-dev}
6
5
 
6
+ # GIT_URL: git@github.com:afeiship/ushell-module-git.git
7
+ GIT_URL=$(git config --get remote.origin.url)
8
+
9
+ # 从 GIT_URL 中 获取 applyai-dev/applyai-frontend
10
+ REPO_PATH=$(echo "$GIT_URL" | awk -F'[:/]' '{print $(NF-1)"/"$NF}' | cut -d '.' -f 1)
11
+
12
+ # 获取当前分支名称
13
+ CURRENT_BRANCH=$(git branch --show-current)
14
+
7
15
  # 打开 GitHub 对比页面
8
- open "https://github.com/applyai-dev/applyai-frontend/compare/$BASE_BRANCH...$(git branch --show-current)?expand=1"
16
+ open "https://github.com/$REPO_PATH/compare/$BASE_BRANCH...$CURRENT_BRANCH?expand=1"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jswork/ushell-module-git",
3
- "version": "1.0.25",
3
+ "version": "1.0.27",
4
4
  "description": "Unix like shell module for git.",
5
5
  "main": "index.sh",
6
6
  "repository": {