From 77badd2eca697733be9af7aa0ed3c37004120f4a Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Fri, 18 Jul 2025 19:49:26 -0400 Subject: [PATCH] Exclude .git files. --- root/live-update.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/root/live-update.sh b/root/live-update.sh index 448757d..f303505 100644 --- a/root/live-update.sh +++ b/root/live-update.sh @@ -6,8 +6,19 @@ pushd /tmp git clone "${gitUrl}" pushd "${gitPath}" git lfs pull +# Files and directories to ignore when copying +ignoreFiles=(".git" "./image" ".git*") +# Build find command with ignore patterns +findArgs=() +for ignore in "${ignoreFiles[@]}"; do + if [[ "$ignore" == .* && "$ignore" != ./* ]]; then + findArgs+=(-name "$ignore" -prune -o) + else + findArgs+=(-path "$ignore" -prune -o) + fi +done # Copy all files as root (preserves permissions properly) -find . -path './.git' -prune -o -path './image' -prune -o -type f -exec bash -c 'for i ; do cp -av --preserve=all --parents "${i}" /;done' _ "{}" \; +find . "${findArgs[@]}" -type f -exec bash -c 'for i ; do cp -av --preserve=all --parents "${i}" /;done' _ "{}" \; # Fix ownership of home directory files chown -R stormux:users /home/stormux popd