fix(deploy): Handle rsync exit code 23 (permission warnings) gracefully

rsync returns exit code 23 for permission warnings which are harmless in WSL2.
With 'set -e', these warnings caused deployment to abort before containers started.

Fix: Catch exit code 23 and continue deployment, only fail on other errors.
This commit is contained in:
uprightbass360
2025-11-15 17:58:05 -05:00
parent 17101ae3c5
commit 05e486ae4f

View File

@@ -54,7 +54,16 @@ sync_local_staging(){
fi
if command -v rsync >/dev/null 2>&1; then
rsync -a --delete "$src_modules"/ "$dest_modules"/
# rsync may return exit code 23 (permission warnings) in WSL2 - these are harmless
rsync -a --delete "$src_modules"/ "$dest_modules"/ || {
local rsync_exit=$?
if [ $rsync_exit -eq 23 ]; then
echo " rsync completed with permission warnings (normal in WSL2)"
else
echo "⚠️ rsync failed with exit code $rsync_exit"
return $rsync_exit
fi
}
else
find "$dest_modules" -mindepth 1 -maxdepth 1 -exec rm -rf {} + 2>/dev/null || true
(cd "$src_modules" && tar cf - .) | (cd "$dest_modules" && tar xf -)