From d8e7452d3d4e57d3f02a025ab813e29f955876f9 Mon Sep 17 00:00:00 2001 From: Sami Samhuri Date: Sat, 9 Nov 2013 23:05:08 -0800 Subject: [PATCH] move zshenv into zshrc --- init.sh | 20 ++++++++++++-------- zsh/zshrc | 17 ++++++++++++++++- zshenv | 19 ------------------- 3 files changed, 28 insertions(+), 28 deletions(-) delete mode 100755 zshenv diff --git a/init.sh b/init.sh index 9ca6361..77d85fb 100755 --- a/init.sh +++ b/init.sh @@ -14,19 +14,23 @@ else fi link_config() { - file="$1" - if [ -e "${HOME}/.$file" ]; then + SRC="$1" + NAME=$(basename "$SRC") + DEST="${HOME}/.${NAME}" + if [ -e "$DEST" ]; then + echo "Existing file found at ${DEST}, moving to ~/original-dot-files." mkdir "${HOME}/original-dot-files" >/dev/null 2>/dev/null - echo "Existing file found at $HOME/.$file, moving to ~/original-dot-files." - mv ".$file" original-dot-files/ + mv "$DEST" original-dot-files/ fi - ln -s "${CONFIG_PATH}/$file" "${HOME}/.$file" + ln -s "$SRC" "$DEST" } cd "$CONFIG_PATH" -for file in *; do - if [ "$file" != "init.sh" ]; then - link_config "$file" +for FILE in *; do + if [ "$FILE" != "init.sh" ]; then + link_config "${CONFIG_PATH}/$FILE" fi done + +link_config "zsh/zshrc" diff --git a/zsh/zshrc b/zsh/zshrc index 444e27e..77c7c11 100755 --- a/zsh/zshrc +++ b/zsh/zshrc @@ -13,7 +13,22 @@ function is_interactive() { [ -t 1 ] } # 1. Environment Vars # =================== -[ -d /usr/local/riak ] && export RIAK=/usr/local/riak +custom_paths=(/sbin /usr/sbin $HOME/bin $HOME/.rbenv/bin /usr/local/android/sdk/tools /usr/local/android/sdk/platform-tools /usr/local/bin /usr/local/share/npm/bin) +for dir in $custom_paths; do + if [[ -d "$dir" ]]; then + path=($dir $path) + fi +done +if [[ -d /Applications/Xcode.app/Contents/Developer/usr/bin ]]; then + path=($path /Applications/Xcode.app/Contents/Developer/usr/bin) +fi +export path +typeset -U path + +[[ -d "$HOME/config/zsh" ]] && ZDOTDIR="$HOME/config/zsh" + +fpath=($fpath $ZDOTDIR/functions) +typeset -U fpath # Android SDK export ANDROID_SDK='/usr/local/android/sdk' diff --git a/zshenv b/zshenv deleted file mode 100755 index 9d26daf..0000000 --- a/zshenv +++ /dev/null @@ -1,19 +0,0 @@ -custom_paths=(/sbin /usr/sbin $HOME/bin $HOME/.rbenv/bin /usr/local/android/sdk/tools /usr/local/android/sdk/platform-tools /usr/local/bin /usr/local/share/npm/bin) -for dir in $custom_paths; do - if [[ -d "$dir" ]]; then - path=($dir $path) - fi -done -if [[ -d /Applications/Xcode.app/Contents/Developer/usr/bin ]]; then - path=($path /Applications/Xcode.app/Contents/Developer/usr/bin) -fi -export path -typeset -U path - -[[ -d "$HOME/config/zsh" ]] && ZDOTDIR="$HOME/config/zsh" - -fpath=($fpath $ZDOTDIR/functions) -typeset -U fpath - -# source non-standard zshrc -. "$ZDOTDIR/zshrc"