Skip to content

Instantly share code, notes, and snippets.

@fliphess
Last active February 19, 2020 13:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fliphess/568e29244b21f21fdb84de52480bf52b to your computer and use it in GitHub Desktop.
Save fliphess/568e29244b21f21fdb84de52480bf52b to your computer and use it in GitHub Desktop.
Easy visiting gitlab urls from your commandline on Mac OSX
#!/usr/bin/env bash
function usage() {
cat <<EOF
Open current git repo in your browser
Arguments:
--pipe - Show pipeline
--cr - Show container registry
--mr - Show merge requests
EOF
exit 1
}
GITLINK="$( git-link | sed -e 's/\.git//' )"
if [ "$1" == "--help" ] || [ "$1" == "-h" ]; then
usage
elif [ "$1" == "--pipe" ] ; then
GITLINK="$GITLINK/pipelines"
elif [ "$1" == "--cr" ] ; then
GITLINK="$GITLINK/container_registry"
elif [ "$1" == "--mr" ] ; then
GITLINK="$GITLINK/merge_requests"
fi
/usr/bin/open "$GITLINK"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment