From 94dea57868fc16d0d6f9fccbeffbaafb585bc5a1 Mon Sep 17 00:00:00 2001 From: Ben Kreeger Date: Sat, 27 Sep 2025 19:21:58 -0500 Subject: [PATCH] Support for cloning into devcontainer --- setup.sh | 2 +- zsh/zprofile | 7 ++++++- zsh/zshrc | 8 +++++++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/setup.sh b/setup.sh index 00273ae..d26b138 100755 --- a/setup.sh +++ b/setup.sh @@ -16,7 +16,7 @@ for directory in "${directories[@]}"; do ln -sfv "$SCRIPTPATH/$directory" "$XDG_CONFIG_HOME/$directory" done -zshfiles=("zshenv" "zprofile" "zshrc") +zshfiles=("zshenv" "zshrc") for file in "${zshfiles[@]}"; do if [[ -a "$HOME/.$file" && $* == *--no-force* ]]; then continue; fi ln -sfv "$SCRIPTPATH/zsh/$file" "$HOME/.$file" diff --git a/zsh/zprofile b/zsh/zprofile index f51aca5..c3fceca 100644 --- a/zsh/zprofile +++ b/zsh/zprofile @@ -1,6 +1,11 @@ # vim: filetype=zsh -SCRIPTPATH=$HOME/.config/dotfiles/zsh +if [[ -d $HOME/.config/dotfiles/zsh ]]; then + SCRIPTPATH=$HOME/.config/dotfiles/zsh +elif [[ -d $HOME/dotfiles/zsh ]]; then + SCRIPTPATH=$HOME/dotfiles/zsh +fi + ZSH_CACHE_DIR="$HOME/.cache/zsh" # Let GPG know which tty we're using and put in charge of SSH auth diff --git a/zsh/zshrc b/zsh/zshrc index 02ba038..9fae579 100644 --- a/zsh/zshrc +++ b/zsh/zshrc @@ -17,7 +17,13 @@ setopt HIST_IGNORE_SPACE setopt AUTO_CD setopt PROMPT_SUBST -SCRIPTPATH=$HOME/.config/dotfiles/zsh +if [[ -d $HOME/.config/dotfiles/zsh ]]; then + SCRIPTPATH=$HOME/.config/dotfiles/zsh +elif [[ -d $HOME/dotfiles/zsh ]]; then + SCRIPTPATH=$HOME/dotfiles/zsh +fi + +source $SCRIPTPATH/zprofile # Use emacs-style binds instead of vim bindkey -e