Skip to content

Commit

Permalink
Remove spaces from scheme names in fixtures (#485)
Browse files Browse the repository at this point in the history
This works around bazelbuild/bazel#4327.
  • Loading branch information
brentleyjones authored May 31, 2022
1 parent fcbd0a8 commit a38a691
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
14 changes: 13 additions & 1 deletion xcodeproj/internal/installer.template.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ while (("$#")); do
dest="${2}"
shift 2
;;
"--remove_spaces")
remove_spaces=true
shift 1
;;
*)
fail "Unrecognized argument: ${1}"
;;
Expand Down Expand Up @@ -56,6 +60,15 @@ rsync \
--delete \
"$src/" "$dest/"

# Remove spaces from filenames if needed
if [[ -n "${remove_spaces:-}" ]]; then
find "$dest/xcshareddata/xcschemes" \
-type f \
-name "* *" \
-exec bash -c 'mv "$0" "${0// /_}"' {} \;
fi

# Make scripts runnable
if [[ -d "$dest/rules_xcodeproj/bazel" ]]; then
chmod u+x "$dest/rules_xcodeproj/bazel/"*.{py,sh}
fi
Expand All @@ -70,7 +83,6 @@ then
fi

# Set desired project.xcworkspace data

workspace_data="$dest/project.xcworkspace/xcshareddata"
if [[ ! -d $workspace_data ]]; then
mkdir -p "$workspace_data"
Expand Down
2 changes: 1 addition & 1 deletion xcodeproj/internal/updater.template.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ for i in "${!specs[@]}"; do
done

for installer in "${installers[@]}"; do
"$installer"
"$installer" --remove_spaces
done

0 comments on commit a38a691

Please sign in to comment.