Skip to content

Fix legacy fixture generation #3158

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 1, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion xcodeproj/internal/templates/legacy_installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,17 @@ if [[ $for_fixture -eq 1 ]]; then
readonly generator_package_name="${generator_package_name_prefix#*/*/*/}"
readonly generator_name="${generator_package_name##*/}"

if command -v /sbin/md5 >/dev/null 2>&1; then
readonly md5_command="/sbin/md5"
elif command -v md5sum >/dev/null 2>&1; then
readonly md5_command="md5sum"
else
fail "ERROR: Unable to find a command to calculate MD5 hash; please install" \
"md5 or md5sum"
fi

# Copy over generated generator
output_base_hash=$(/sbin/md5 -q -s "${execution_root%/*/*}")
output_base_hash=$(echo "${execution_root%/*/*}" | "$md5_command" | awk '{print $1}')
readonly src_generator_package_directory="/var/tmp/rules_xcodeproj/generated_v2/$output_base_hash/generator/$generator_package_name"
readonly dest_generator_package_directory="$project_dir/generated"
readonly dest_generator_package="${dest_generator_package_directory:?}/$generator_name"
Expand Down