Last active
September 15, 2023 13:45
-
-
Save luizcarvalho/f1d01f2a07e54a4a4b13b830a8121ff5 to your computer and use it in GitHub Desktop.
Script to open or create issue in Gitlab using fish shell for WSL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function open_issue | |
set DISPLAY :0 | |
set BROWSER /usr/bin/wslview | |
set -g ISSUE_ID (git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/[^0-9]*//g') | |
set -g PROJECT_NAME (basename $PWD) | |
set -g GITLAB_BASE_URL https://gitlab.com | |
if test $ISSUE_ID | |
# echo (git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/') | |
echo "⚡ Opening issue $ISSUE_ID " | |
sensible-browser "$GITLAB_BASE_URL/$PROJECT_NAME/-/issues/$ISSUE_ID" | |
else | |
sensible-browser "$GITLAB_BASE_URL/$PROJECT_NAME/-/issues/new?issuable_template=feature" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment