diff options
author | Jacob Janzen <jjanzenn@proton.me> | 2024-08-07 15:19:12 -0500 |
---|---|---|
committer | Jacob Janzen <jjanzenn@proton.me> | 2024-08-07 15:19:12 -0500 |
commit | 5f28612db307ac8ad3d7602afe0081acbf92e257 (patch) | |
tree | 0d34347196c924aa20d22b2ea0cc464d569d771b | |
parent | 4f6d8ff6c4cf5a2036c180dd0c7ccb1eedd39f5f (diff) |
pull before updating script
-rwxr-xr-x | update-home | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/update-home b/update-home index 03b39a4..0e6fd8f 100755 --- a/update-home +++ b/update-home @@ -6,6 +6,14 @@ if ! test -d ~/.dotfiles; then git clone git@git.sr.ht:~jjanzen/.dotfiles ~/.dotfiles fi +# save the current working directory and move to the dotfiles repository +CWD=$(pwd) +cd ~/.dotfiles || exit +git stash +git checkout main +git pull --rebase + +# Install new update-home script and run it instead of this if ! diff ~/.dotfiles/update-home ~/.local/bin/update-home; then cp ~/.dotfiles/update-home ~/.local/bin/update-home || exit 1 echo Changes have been made to the update-home script. @@ -14,13 +22,7 @@ if ! diff ~/.dotfiles/update-home ~/.local/bin/update-home; then exit fi -# save the current working directory and move to the dotfiles repository -CWD=$(pwd) -cd ~/.dotfiles || exit -git stash -git checkout main -git pull --rebase - +# install config files find -- * -type f -name "*.org" | while read -r file; do echo Installing "${file}" configuration... # emacs --batch "${file}" -f package-initialize --eval '(org-babel-tangle)' |