Litte setup improvement

This commit is contained in:
nold 2022-05-01 20:10:08 +02:00
parent e733c6af80
commit 4c9c1d5eea
1 changed files with 8 additions and 1 deletions

View File

@ -2,6 +2,11 @@
set -u
mkdir -p ~/.config/homedir-backup 2>/dev/null
echo Doing self-update
if ! git pull ; then
echo "Git pull failed.. continuing in unknown state..."
fi
# Creates Directories & linkes files to this repo
function linkfiles {
for file in $@; do
@ -24,7 +29,8 @@ function linkfiles {
# Backup local dotfiles:
if [ ! -L ~/.${targetdir}${name} ] ; then
mv -v "${HOME}/.${targetdir}${name}" ~/.config/homedir-backup
mkdir -p ~/.config/homedir-backup/${targetdir}
mv -v "${HOME}/.${targetdir}${name}" ~/.config/homedir-backup/${targetdir}
fi
# Fix broken links
@ -98,3 +104,4 @@ grep -qE "^source.*$(pwd)/bashrc" ~/.bashrc || echo "source $(pwd)/bashrc" >> ~/
echo
echo All Done. Happy Hacking.
exit 0