Use copy.sh-injected DOT_DIR instead of SCRIPT_DIR
This commit is contained in:
parent
e6a24f177c
commit
74a178045e
5
copy.sh
5
copy.sh
|
@ -23,7 +23,10 @@ echo "$dotfiles" | while read -r dotfile; do
|
||||||
ln -sf "$dotfile" "$new"
|
ln -sf "$dotfile" "$new"
|
||||||
done
|
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
|
if [[ "$1" == "--files-only" ]]; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
export SCRIPT_DIR="${0:A:h}"
|
|
||||||
|
|
||||||
if test -f /usr/share/doc/fzf/examples/completion.zsh &> /dev/null; then
|
if test -f /usr/share/doc/fzf/examples/completion.zsh &> /dev/null; then
|
||||||
source /usr/share/doc/fzf/examples/completion.zsh
|
source /usr/share/doc/fzf/examples/completion.zsh
|
||||||
fi
|
fi
|
||||||
|
@ -66,8 +64,11 @@ if [ "$TERM" = "linux" ]; then
|
||||||
SetTtyColors
|
SetTtyColors
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
source ~/.shell_aliases
|
||||||
|
source ~/.zsh_local
|
||||||
|
|
||||||
function pushdot {
|
function pushdot {
|
||||||
cd "$SCRIPT_DIR" || return 1
|
cd "$DOT_DIR" || return 1
|
||||||
if [ $# -eq 0 ]; then
|
if [ $# -eq 0 ]; then
|
||||||
git commit -a && git push -u origin main &
|
git commit -a && git push -u origin main &
|
||||||
else
|
else
|
||||||
|
@ -77,14 +78,11 @@ function pushdot {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getdot {
|
function getdot {
|
||||||
cd "$SCRIPT_DIR" || return 1
|
cd "$DOT_DIR" || return 1
|
||||||
git pull
|
git pull
|
||||||
cd -
|
cd -
|
||||||
}
|
}
|
||||||
|
|
||||||
source ~/.shell_aliases
|
|
||||||
source ~/.zsh_local
|
|
||||||
|
|
||||||
if which starship &> /dev/null; then
|
if which starship &> /dev/null; then
|
||||||
eval "$(starship init zsh)"
|
eval "$(starship init zsh)"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue