openpr (306B) [raw]
1 #!/bin/sh 2 # openpr -- open a pr from GitHub 3 set -e 4 die() { 5 echo "$*" 1>&2 6 exit 1 7 } 8 9 [ -z "$1" ] && die "usage: openpr NUM" 10 11 num=${1###} 12 13 url=$(git remote get-url origin | sed -e 's/^git@//' -e 's@:@/@' -e 's/\.git$//') 14 15 [ -z "$url" ] && die "not in a repo?" 16 17 ${BROWSER:-firefox} "https://$url/pull/$num"