1
0
forked from extern/nix-config
donovanglover-nix-config/dots/common/.config/fish/functions/hub.fish
Donovan Glover cb4278514d
Drop zsh support in favor of fish
Really, there is no reason to use zsh when fish exists, at least not for
my use case. Maintaining one set of shell config files is easier than
two, so I'm removing the zsh files.

Some other changes in this commit include:

- The addition of the current user and hostname to the fish prompt
- The addition of some zsh functions I re-implemented in fish
- The removal of the dircolors file (not needed with exa anyway)
- The removal of some aliases I never used
-
2018-09-07 13:30:22 -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