Skip to content

Instantly share code, notes, and snippets.

@fzerorubigd
Created December 22, 2014 07:11
Show Gist options
  • Save fzerorubigd/ebb59b11094e64b14926 to your computer and use it in GitHub Desktop.
Save fzerorubigd/ebb59b11094e64b14926 to your computer and use it in GitHub Desktop.
#!/bin/env zsh
ROOT=~/.profiles
if [ -z $PROFILE_DIR ] || [ -z PROFILE_HISTORY ];then
pushd $ROOT >/dev/null
FILES=($ROOT/*/)
FILES+=("Exit")
select f in ${FILES[*]}
do
if [[ "$f" == 'Exit' ]];then
return
fi
if [ -f "$f/zshrc" ];then
PROFILE_DIR="$f"
PROFILE_HISTORY="${PROFILE_DIR}zsh_history"
break
fi
done
export PROFILE_DIR
export PROFILE_HISTORY
popd >/dev/null
fi
export HISTFILE=$PROFILE_HISTORY
source $PROFILE_DIR/zshrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment