1
0
mirror of https://github.com/balkian/dotfiles.git synced 2024-11-23 20:52:28 +00:00

Use stow in make.sh

This commit is contained in:
J. Fernando Sánchez 2017-03-24 16:51:13 +01:00
parent fc49bdf6c4
commit 37837558b1
2 changed files with 3 additions and 12 deletions

View File

@ -1,4 +1,4 @@
FROM ubuntu:14.04
FROM ubuntu:16.04
RUN apt-get update -y
RUN apt-get install -y build-essential

13
make.sh
View File

@ -14,20 +14,11 @@ git submodule init
git submodule update --recursive
olddir=~/dotfiles$(date +%Y-%m-%d_%H:%M:%S) # old dotfiles backup directory
files=$(ls --ignore="not_dots" --ignore="README.md" --ignore="make.sh" --ignore="Docker" $PWD) # list of files/folders to symlink in homedir
files=$(ls -1 --ignore="not_dots" --ignore="README.md" --ignore="make.sh" --ignore="Docker" $PWD) # list of files/folders to symlink in homedir
##########
# create dotfiles_old in homedir
echo "** Creating $olddir for backup: of any existing dotfiles in ~"
mkdir -p $olddir
echo "...done"
# move any existing dotfiles in homedir to dotfiles_old directory, then create symlinks
echo "** Creating symlinks. Any existing dotfiles will be moved to: $olddir"
for file in $files; do
mv ~/.$file $olddir && echo "Backed up: ~/.$file"
ln -s $PWD/$file ~/.$file
stow -v $file
done
rmdir $olddir 2>/dev/null && echo "Backup dir empty. Removed"