diff --git a/xcodeproj/internal/templates/runner.sh b/xcodeproj/internal/templates/runner.sh index 84887a14d..f3f7f76bf 100644 --- a/xcodeproj/internal/templates/runner.sh +++ b/xcodeproj/internal/templates/runner.sh @@ -178,10 +178,12 @@ else xcode_version="" fi +touch "$pre_xcodeproj_bazelrc_dir/pre_xcodeproj.bazelrc" + # We write to a `.bazelrc` file instead of passing flags directly in order to # support all Bazel commands via the `common` pseudo-command if [[ -n "$xcode_version" ]]; then - cat < "$pre_xcodeproj_bazelrc_dir/pre_xcodeproj.bazelrc" + cat <> "$pre_xcodeproj_bazelrc_dir/pre_xcodeproj.bazelrc" # Be explicit about our desired Xcode version common:rules_xcodeproj --xcode_version=$xcode_version @@ -194,7 +196,7 @@ EOF fi if [[ -n "$developer_dir" ]]; then - cat <> "$pre_xcodeproj_bazelrc_dir/pre_xcodeproj.bazelrc" + cat <> "$pre_xcodeproj_bazelrc_dir/pre_xcodeproj.bazelrc" # Set \`DEVELOPER_DIR\` in case a bazel wrapper filters it common:rules_xcodeproj --repo_env="DEVELOPER_DIR=$developer_dir"