1
0
forked from extern/nix-config
donovanglover-nix-config/.config/fish/functions/hub.fish
Donovan Glover 4e65100b5e
Update fish config
Setting XDG_CURRENT_DESKTOP and QT_FONT_DPI lets us run KDE applications
in bspwm with near-identical settings without starting plasmashell.
2018-10-03 15:34:11 -04:00

19 lines
580 B
Fish

# Easily clone and cd into GitHub repositories
# Usage: hub username/repository [upstream]
function hub --argument-names "path" "upstream"
if test -n "$path"
git clone ssh://git@github.com/$path.git
cd (basename "$path")
if test -n "$upstream"
git remote add upstream \
ssh://git@github.com/$upstream/(basename "$path").git
else
echo "Note: No upstream was specified."
end
else
echo "No repository was specified."
echo "Usage: hub username/repository [upstream]"
end
end