Add post install/update functionality.
This commit is contained in:
parent
da19c0a6c9
commit
c9d2cf6c80
@ -65,6 +65,9 @@ if [[ -f ~/.note ]]; then
|
||||
echo
|
||||
fi
|
||||
|
||||
# cleaning
|
||||
rm -rf ~/.warprc
|
||||
|
||||
# local settings
|
||||
if [[ -f ~/.local/config/zsh ]]; then
|
||||
source ~/.local/config/zsh
|
||||
|
@ -46,7 +46,7 @@ fi
|
||||
|
||||
function ud() {
|
||||
for i in ${LOCAL_GIT_DIR}/dotfiles ${LOCAL_GIT_DIR}/zsh_modules/*; do git -C ${i} pull; done
|
||||
nvim -c "lua require('lazy').sync({wait = true})"
|
||||
. ${LOCAL_GIT_DIR}/dotfiles/scripts/post-update.sh
|
||||
}
|
||||
|
||||
function upgrade() {
|
||||
|
@ -8,7 +8,7 @@ XDG_DATA_HOME=${HOME}/.local/share
|
||||
XDG_STATE_HOME=${HOME}/.local/state
|
||||
|
||||
# clean + prepare local dirs
|
||||
rm -rf ~/.cache ~/.config/_cache ~/.fdignore ~/.fzf.bash ~/.fzf.zsh ~/.gitconfig ~/.gitignore ~/.history ~/.tmux.conf ~/.vim* ~/.zcomp* ~/.zsh*
|
||||
rm -rf ~/.cache ~/.config/_cache ~/.fdignore ~/.fzf.bash ~/.fzf.zsh ~/.gitconfig ~/.gitignore ~/.history ~/.hushlogin ~/.tmux.conf ~/.vim* ~/.zcomp* ~/.zsh*
|
||||
rm -rf ${XDG_CACHE_HOME} ${XDG_DATA_HOME}/nvim ${XDG_STATE_HOME}/nvim
|
||||
mkdir -p ${XDG_CACHE_HOME} ${XDG_CONFIG_HOME} ${XDG_DATA_HOME}
|
||||
chmod 700 ${XDG_CACHE_HOME}
|
||||
@ -31,5 +31,7 @@ for i in ${LOCAL_GIT_DIR}/dotfiles/config/*; do
|
||||
ln -sf ${LOCAL_GIT_DIR}/dotfiles/config/$(basename $i) ${XDG_CONFIG_HOME}/
|
||||
done
|
||||
|
||||
# nvim setup
|
||||
nvim -c "lua require('lazy').sync({wait = true})" -c "MasonInstallAll"
|
||||
# execute post-install script
|
||||
printf "Running post-install script... "
|
||||
. ${LOCAL_GIT_DIR}/dotfiles/scripts/post-install.sh
|
||||
echo "done."
|
||||
|
13
scripts/post-install.sh
Normal file
13
scripts/post-install.sh
Normal file
@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
# basic git configuration
|
||||
if [[ ! -d ${XDG_CONFIG_HOME}/git ]]; then
|
||||
mkdir -p ${XDG_CONFIG_HOME}/git
|
||||
cat << EOF > ${XDG_CONFIG_HOME}/git/config
|
||||
[pull]
|
||||
rebase = true
|
||||
EOF
|
||||
fi
|
||||
|
||||
# nvim setup
|
||||
nvim -c "lua require('lazy').sync({wait = true})" -c "MasonInstallAll"
|
3
scripts/post-update.sh
Normal file
3
scripts/post-update.sh
Normal file
@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
nvim -c "lua require('lazy').sync({wait = true})"
|
Loading…
Reference in New Issue
Block a user