diff --git a/xcodeproj/internal/templates/installer.sh b/xcodeproj/internal/templates/installer.sh index 91cd16471..8ea552732 100644 --- a/xcodeproj/internal/templates/installer.sh +++ b/xcodeproj/internal/templates/installer.sh @@ -90,19 +90,24 @@ readonly dest_xcschemes="$dest/xcshareddata/xcschemes" mkdir -p "$dest_xcschemes" -"$src_rsync" \ - --archive \ - --perms \ - --chmod=u+w,F-x \ - --delete \ - "$src_xcschemes" "$dest_xcschemes/" - if [[ $(uname) == "Darwin" ]]; then is_macos=1 + readonly rsync="$src_rsync" else is_macos=0 + readonly rsync="$(command -v rsync || true)" + [[ -n "$rsync" ]] || fail \ + "Failed to locate host rsync." \ + "rules_xcodeproj's bundled rsync is only supported on macOS project generation." fi +"$rsync" \ + --archive \ + --perms \ + --chmod=u+w,F-x \ + --delete \ + "$src_xcschemes" "$dest_xcschemes/" + # Resolve the copy command (can't use `cp -c` if the files are on different # filesystems, or on Linux) if [[ $is_macos -eq 1 &&