Created
May 10, 2016 08:57
-
-
Save kuoe0/1091c0ad3a4e7c993acf1e71fe907b22 to your computer and use it in GitHub Desktop.
Autoenv for Gecko
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################################################################ | |
# Usage: ln -s </path/to/this/file> $GECKO/.autoenv.zsh | |
################################################################################ | |
OS=$(uname) | |
autostash GECKO=$(git rev-parse --show-toplevel) | |
alias mach="$GECKO/mach" | |
# Load completion for mach | |
autoload bashcompinit | |
bashcompinit | |
source "$GECKO/python/mach/bash-completion.sh" | |
# Load git-cinnabar | |
if echo "$PATH" | grep -q "cinnabar"; then | |
echo "git-cinnabar is already ready!" | |
else | |
LOCATE="locate" | |
[[ "$OS" = "Darwin" ]] && LOCATE="mdfind" # use `mdfind` in OS X as locate | |
if [[ -z ${CINNABAR_PATH+x} ]]; then | |
# cache CINNABAR_PATH | |
export CINNABAR_PATH=$($LOCATE git-cinnabar | grep cinnabar | sort | head -n 1) | |
fi | |
autostash PATH="$CINNABAR_PATH:$PATH" | |
echo "git-cinnabar is ready!" | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################################################################ | |
# Usage: ln -s </path/to/this/file> $GECKO/.autoenv_leave.zsh | |
################################################################################ | |
unalias mach |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment