From 1b1d5ebbeda550c06e24b8b071ac55aae0879143 Mon Sep 17 00:00:00 2001 From: Brian Zalewski Date: Wed, 30 Nov 2022 08:29:08 +0000 Subject: [PATCH] Update .local/bin/provision --- .local/bin/provision | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/.local/bin/provision b/.local/bin/provision index 6bbf44e7..27d4b79a 100644 --- a/.local/bin/provision +++ b/.local/bin/provision @@ -177,17 +177,23 @@ fi ### Copy folders find /usr/local/src/hiawatha -maxdepth 1 -mindepth 1 -type d | while read FOLDER; do BASENAME="$(basename "$FOLDER")" - if [ ! -d "$HOME/$BASENAME" ]; then - mkdir -p "$HOME/$BASENAME" + # Prevent initial-scaffolding of OS-specific files since Chezmoi will handle them + if [[ "$BASENAME" != 'AppData' ]] && [[ "$BASENAME" != 'Library' ]]; then + if [ ! -d "$HOME/$BASENAME" ]; then + mkdir -p "$HOME/$BASENAME" + fi + cp -rf "$FOLDER/"* "$HOME/$BASENAME" fi - cp -rf "$FOLDER/"* "$HOME/$BASENAME" done ### Copy files find /usr/local/src/hiawatha -maxdepth 1 -mindepth 1 -type f | while read FILE; do BASENAME="$(basename "$FILE")" - cp "$FILE" "$HOME/$BASENAME" - chmod 600 "$HOME/$BASENAME" + # Prevent repository-specific files from being copied over to user's HOME + if [[ "$BASENAME" != *'.md' ]] && [[ "$BASENAME" != *'.sh' ]] && [ "$BASENAME" != 'logo.png' ] && [ "$BASENAME" != '.gitlab-ci.yml' ]; then + cp "$FILE" "$HOME/$BASENAME" + chmod 600 "$HOME/$BASENAME" + fi done ### Ensure ~/.local/bin files are executable