+# get latest hub and run it
+# main command to use:
+# hub pull-request --no-edit
+# --no-edit means to use the first commit\'s message as the pull request message.
+# Also, you need to use a feature branch, not master in your fork.
+# On first use, you input username/pass and it gets an oath token so you dont have to repeat
+# it\'s at ~/.config/hub
+hub() {
+ local up uptar updir p
+ p=/github/hub/releases/
+ up=https://github.com/$(curl -s https://github.com$p| grep -o $p'download/[^/]*/hub-linux-amd64[^"]*' | head -n1)
+ uptar=${up##*/}
+ updir=${uptar%.tgz}
+ if [[ ! -e /a/opt/$updir ]]; then
+ rm -rf /a/opt/hub-linux-amd64*
+ wget -P /a/opt $up
+ tar -C /a/opt -zxf /a/opt/$uptar
+ rm -f /a/opt/$uptar
+ s /a/opt/$updir/install
+ fi
+
+ # save token across computers
+ if [[ ! -L ~/.config/hub ]]; then
+ if [[ -e ~/.config/hub ]]; then
+ mv ~/.config/hub /p/c/subdir_files/.config/
+ fi
+ if [[ -e /p/c/subdir_files/.config/hub ]]; then
+ conflink
+ fi
+ fi
+ command hub "$@"
+}