diff --git a/dotfiles-old/clone.sh b/dotfiles-old/clone.sh index 1039bf5..0be3a4b 100755 --- a/dotfiles-old/clone.sh +++ b/dotfiles-old/clone.sh @@ -2,8 +2,22 @@ SRC="$HOME" DEST="$(pwd)" [ "$(printf "Abort.\nContinue.\n" | dmenu -p "Copying from '$SRC' to '$DEST'. Continue?")" = "Continue." ] || exit -set -x +set -ex -for file in $(cat manifest); do - cp "$SRC/$file" "$DEST/$file" +for dir in $(cat manifest_dir); do + if ! [ -d "$SRC/$dir" ]; then + printf "Directory missing from SRC: %b\n" "$dir" + false + else + mkdir -p "$DEST/$dir" + fi +done + +for file in $(cat manifest_file); do + if ! [ -e "$SRC/$file" ]; then + printf "File missing from SRC: %b\n" "$file" + false + else + cp "$SRC/$file" "$DEST/$file" + fi done diff --git a/dotfiles-old/manifest_dir b/dotfiles-old/manifest_dir new file mode 100644 index 0000000..5eb7e3b --- /dev/null +++ b/dotfiles-old/manifest_dir @@ -0,0 +1,8 @@ +.config/ +.config/bspwm/ +.config/i3/ +.config/i3status/ +.config/sxhkd/ +.config/sxhkd/ +.config/sxhkd/ +src/dmenu/ diff --git a/dotfiles-old/manifest b/dotfiles-old/manifest_file similarity index 100% rename from dotfiles-old/manifest rename to dotfiles-old/manifest_file