Add post install/update functionality.

This commit is contained in:
Bartek Stalewski 2024-06-25 00:06:22 +02:00
parent da19c0a6c9
commit c9d2cf6c80
Signed by: ftpd
SSH Key Fingerprint: SHA256:vGQiaNJcfUMLt3wF58+Zx15C6SpRDA9spUeggjVY8Yo
5 changed files with 25 additions and 4 deletions

View File

@ -65,6 +65,9 @@ if [[ -f ~/.note ]]; then
echo echo
fi fi
# cleaning
rm -rf ~/.warprc
# local settings # local settings
if [[ -f ~/.local/config/zsh ]]; then if [[ -f ~/.local/config/zsh ]]; then
source ~/.local/config/zsh source ~/.local/config/zsh

View File

@ -46,7 +46,7 @@ fi
function ud() { function ud() {
for i in ${LOCAL_GIT_DIR}/dotfiles ${LOCAL_GIT_DIR}/zsh_modules/*; do git -C ${i} pull; done 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() { function upgrade() {

View File

@ -8,7 +8,7 @@ XDG_DATA_HOME=${HOME}/.local/share
XDG_STATE_HOME=${HOME}/.local/state XDG_STATE_HOME=${HOME}/.local/state
# clean + prepare local dirs # 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 rm -rf ${XDG_CACHE_HOME} ${XDG_DATA_HOME}/nvim ${XDG_STATE_HOME}/nvim
mkdir -p ${XDG_CACHE_HOME} ${XDG_CONFIG_HOME} ${XDG_DATA_HOME} mkdir -p ${XDG_CACHE_HOME} ${XDG_CONFIG_HOME} ${XDG_DATA_HOME}
chmod 700 ${XDG_CACHE_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}/ ln -sf ${LOCAL_GIT_DIR}/dotfiles/config/$(basename $i) ${XDG_CONFIG_HOME}/
done done
# nvim setup # execute post-install script
nvim -c "lua require('lazy').sync({wait = true})" -c "MasonInstallAll" printf "Running post-install script... "
. ${LOCAL_GIT_DIR}/dotfiles/scripts/post-install.sh
echo "done."

13
scripts/post-install.sh Normal file
View 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
View File

@ -0,0 +1,3 @@
#!/bin/sh
nvim -c "lua require('lazy').sync({wait = true})"