Litte setup improvement
This commit is contained in:
parent
e733c6af80
commit
4c9c1d5eea
1 changed files with 8 additions and 1 deletions
9
setup.sh
9
setup.sh
|
@ -2,6 +2,11 @@
|
||||||
set -u
|
set -u
|
||||||
mkdir -p ~/.config/homedir-backup 2>/dev/null
|
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
|
# Creates Directories & linkes files to this repo
|
||||||
function linkfiles {
|
function linkfiles {
|
||||||
for file in $@; do
|
for file in $@; do
|
||||||
|
@ -24,7 +29,8 @@ function linkfiles {
|
||||||
|
|
||||||
# Backup local dotfiles:
|
# Backup local dotfiles:
|
||||||
if [ ! -L ~/.${targetdir}${name} ] ; then
|
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
|
fi
|
||||||
|
|
||||||
# Fix broken links
|
# Fix broken links
|
||||||
|
@ -98,3 +104,4 @@ grep -qE "^source.*$(pwd)/bashrc" ~/.bashrc || echo "source $(pwd)/bashrc" >> ~/
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo All Done. Happy Hacking.
|
echo All Done. Happy Hacking.
|
||||||
|
exit 0
|
||||||
|
|
Loading…
Reference in a new issue