Use copy.sh-injected DOT_DIR instead of SCRIPT_DIR

This commit is contained in:
Sage Vaillancourt 2023-12-13 15:09:02 -05:00
parent e6a24f177c
commit 74a178045e
2 changed files with 9 additions and 8 deletions

View File

@ -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

View File

@ -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