-
-
Save fzerorubigd/ebb59b11094e64b14926 to your computer and use it in GitHub Desktop.
This file contains 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
#!/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