From 4ef0ca5e2d39461be958f67d023b98375e1bb4a0 Mon Sep 17 00:00:00 2001 From: Deven Blake Date: Mon, 10 May 2021 22:06:25 -0400 Subject: [PATCH] mkdir in cloning --- dotfiles-old/clone.sh | 20 +++++++++++++++++--- dotfiles-old/manifest_dir | 8 ++++++++ dotfiles-old/{manifest => manifest_file} | 0 3 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 dotfiles-old/manifest_dir rename dotfiles-old/{manifest => manifest_file} (100%) 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