Skip to content

Instantly share code, notes, and snippets.

@GeneralD
Created July 20, 2017 06:41
Show Gist options
  • Save GeneralD/23b0f447858a46842295a7f19a482e86 to your computer and use it in GitHub Desktop.
Save GeneralD/23b0f447858a46842295a7f19a482e86 to your computer and use it in GitHub Desktop.
zshのパス設定の順序の問題 ref: http://qiita.com/GeneralD/items/a87d5d145149a9d214c6
export PATH=...
path=(
~/.anyenv/bin(N-/)
$path
)
brew install --without-etcdir zsh
chsh -s /user/local/bin/zsh
# system-wide environment settings for zsh
if [ -x /usr/libexec/path_helper ]; then
eval `/usr/libexec/path_helper -s`
fi
# environment paths
path=(
~/.anyenv/bin(N-/)
$path
)
OMZ=$HOME/.oh-my-zsh
# install oh-my-zsh if needed
if [[ ! -e $OMZ ]]; then;
cd ~ && sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
fi
# use zsh version of without-etcdir to ignore setting files under /etc directory
if [ $SHELL = '/bin/zsh' ]; then
echo -e '\e[31mDefault zsh loads /etc/zprofile. It causes changing order of environment path.'
if [[ ! -x /usr/local/bin/zsh ]]; then
echo '\e[32mInstalling zsh without etcdir'
/usr/local/bin/brew install --without-etcdir zsh
echo '\e[32mPlease add /usr/local/bin/zsh to /etc/shells to use it as default shell!'
fi
chsh -s /usr/local/bin/zsh
exit
fi
# prevent line added Unintentionally
:<< COMMENTOUT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment