Cleanup
This commit is contained in:
parent
63a73b9ed1
commit
423f0393ba
@ -2,32 +2,32 @@
|
|||||||
mkdir -p ~/.config
|
mkdir -p ~/.config
|
||||||
|
|
||||||
# Link all dotfiles
|
# Link all dotfiles
|
||||||
for entry in dotfiles/*; do
|
for entry in ~/.local/share/omakub/dotfiles/*; do
|
||||||
# Link all root files as .file in ~/
|
# Link all root files as .file in ~/
|
||||||
# Any existing files will be renamed .bak
|
# Any existing files will be renamed .bak
|
||||||
if [ -f "$entry" ]; then
|
if [ -f $entry ]; then
|
||||||
target=~/."$(basename "$entry")"
|
target=~/."$(basename $entry)"
|
||||||
|
|
||||||
if [ -e "$target" ] && [ "$(readlink "$target")" != "$(pwd)/$entry" ]; then
|
if [ -e $target ] && [ "$(readlink $target)" != $entry ]; then
|
||||||
mv "$target" "$target.bak"
|
mv $target $target.bak
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -e "$target" ]; then
|
if [ ! -e $target ]; then
|
||||||
ln -s "$(pwd)/$entry" "$target"
|
ln -s $entry $target
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Link all directories in ~/.config/
|
# Link all directories in ~/.config/
|
||||||
# Any existing directories will be renamed .bak
|
# Any existing directories will be renamed .bak
|
||||||
if [ -d "$entry" ]; then
|
if [ -d $entry ]; then
|
||||||
target=~/.config/"$(basename "$entry")"
|
target=~/.config/"$(basename $entry)"
|
||||||
|
|
||||||
if [ -e "$target" ] && [ "$(readlink "$target")" != "$(pwd)/$entry" ]; then
|
if [ -e $target ] && [ "$(readlink "$target")" != $entry ]; then
|
||||||
mv "$target" "$target.bak"
|
mv $target $target.bak
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -e "$target" ]; then
|
if [ ! -e $target ]; then
|
||||||
ln -s "$(pwd)/$entry" "$target"
|
ln -s $entry $target
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
Loading…
Reference in New Issue
Block a user