Skip to content

Instantly share code, notes, and snippets.

@willeccles
Last active January 27, 2017 16:11
Show Gist options
  • Save willeccles/659431f36df631beaa170876de8fbb8d to your computer and use it in GitHub Desktop.
Save willeccles/659431f36df631beaa170876de8fbb8d to your computer and use it in GitHub Desktop.
A bash script to easily open a repo on GitHub.com
#! /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