You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
726 B

#!/bin/bash
set -euo pipefail
OLDIR="$PWD"
cd "$DTTR_OUT"
if [ -L "$HOME/.Xresources" ]; then
unlink "$HOME/.Xresources"
fi
# Create directories to symlink single files
for dir in $(find . -type d); do
_path=$(echo "$dir" | cut -d'/' -f3-)
c=$(echo "$_path" | wc -m)
if [ $c -gt 1 ]; then
abspath="$HOME/$_path"
[ ! -d "$abspath" ] && mkdir -p "$abspath"
fi
done
if [ -d "$HOME/.dotfiles" ]; then
cd "$HOME/.dotfiles"
for dir in $(find . -maxdepth 1 -type d -printf "%f\n" | grep -v '\.'); do
stow -D -d "$HOME/.dotfiles" -t "$HOME" "$dir" &> /dev/null || true
done
cd $OLDIR
fi
echo "Unlinking dotfiles dir"
if [ -L "$HOME/.dotfiles" ]; then
unlink "$HOME/.dotfiles"
fi