diff --git a/copy.sh b/copy.sh index 6cc5c6c..d99dea7 100755 --- a/copy.sh +++ b/copy.sh @@ -23,7 +23,10 @@ echo "$dotfiles" | while read -r dotfile; do ln -sf "$dotfile" "$new" done -touch "$HOME/.zsh_local" +if ! grep DOT_DIR $HOME/.zsh_local; then + echo "export DOT_DIR=\"$SCRIPT_DIR\"" >> $HOME/.zsh_local +fi + if [[ "$1" == "--files-only" ]]; then exit 0 fi diff --git a/fake_home/.zshrc b/fake_home/.zshrc index 30167ee..d3aad88 100644 --- a/fake_home/.zshrc +++ b/fake_home/.zshrc @@ -1,5 +1,3 @@ -export SCRIPT_DIR="${0:A:h}" - if test -f /usr/share/doc/fzf/examples/completion.zsh &> /dev/null; then source /usr/share/doc/fzf/examples/completion.zsh fi @@ -66,8 +64,11 @@ if [ "$TERM" = "linux" ]; then SetTtyColors fi +source ~/.shell_aliases +source ~/.zsh_local + function pushdot { - cd "$SCRIPT_DIR" || return 1 + cd "$DOT_DIR" || return 1 if [ $# -eq 0 ]; then git commit -a && git push -u origin main & else @@ -77,14 +78,11 @@ function pushdot { } function getdot { - cd "$SCRIPT_DIR" || return 1 + cd "$DOT_DIR" || return 1 git pull cd - } -source ~/.shell_aliases -source ~/.zsh_local - if which starship &> /dev/null; then eval "$(starship init zsh)" fi