Skip to content

Instantly share code, notes, and snippets.

@kuoe0 kuoe0/.autoenv.zsh
Created May 10, 2016

Embed
What would you like to do?
Autoenv for Gecko
################################################################################
# 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
################################################################################
# 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
You can’t perform that action at this time.