Created
January 13, 2016 12:15
-
-
Save hmps/d7385f019483d4ab674d to your computer and use it in GitHub Desktop.
Open Git remote url in Safari
This file contains hidden or 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
#!/bin/bash | |
# | |
# Usage | |
# 1. Put this file somewhere safe in your file system | |
# 2. Make sure it is executable: chmod +x gor.sh | |
# 3. Create an alias in your CLI. | |
# | |
# Example alias: | |
# alias gor='bash ~/.cli-scripts/gor.sh'; | |
if url=$(git remote -v | grep -Eo -m 1 'http.*. ') | |
then | |
open -a"Safari" $url | |
else | |
echo "Could not find a remote url." | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment