-
-
Save JohnSundell/4354bbe7f31f66e794da489d4da72183 to your computer and use it in GitHub Desktop.
Script that makes it easy to show a Git repo on GitHub.com
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
#!/usr/bin/env bash | |
# If run without a name, open any current repo | |
if [ -z "$1" ]; then | |
URL=$(git remote get-url origin) | |
URL=${URL/"[email protected]:"/"https://github.com/"} | |
URL=${URL/".git"/""} | |
open $URL | |
else | |
open "https://github.com/$1" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@Abizern @JohnSundell personally I really love writing a bunch of tiny shell scripts for the following reasons:
I have a similar script for opening Xcode from the current directory. Handles multiple projects/workspaces (via option list) etc...
openx
Not the best code but if you want it:
https://gist.github.com/shaps80/9652980