Last active
January 27, 2017 16:11
-
-
Save willeccles/659431f36df631beaa170876de8fbb8d to your computer and use it in GitHub Desktop.
A bash script to easily open a 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
#! /bin/bash | |
# likely only works on OS X, but hey, that's just too bad :) | |
# default username if one is not given | |
username="willeccles" | |
if (( $# >= 2 )); then | |
open "https://www.github.com/$1/$2" | |
elif (( $# == 1 )); then | |
open "https://www.github.com/$username/$1" | |
elif (( $# == 0 )); then | |
echo "usage: gitrepo [username] <repository>" | |
echo " repository: the name of the repo to open" | |
echo " username: name of the user who owns the repo" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment