diff --git a/xcodeproj/internal/templates/runner.sh b/xcodeproj/internal/templates/runner.sh index 13d79cc63..7241e1774 100644 --- a/xcodeproj/internal/templates/runner.sh +++ b/xcodeproj/internal/templates/runner.sh @@ -169,17 +169,12 @@ if [[ -s "$extra_flags_bazelrc" ]]; then bazelrcs+=("--bazelrc=$extra_flags_bazelrc") fi -developer_dir=$(xcode-select -p) - # We write to a `.bazelrc` file instead of passing flags directly in order to # support all Bazel commands via the `common` pseudo-command cat > "$pre_xcodeproj_bazelrc_dir/pre_xcodeproj.bazelrc" </dev/null 2>&1; then + developer_dir=$(/usr/bin/xcode-select -p) +else + developer_dir="${DEVELOPER_DIR:-}" +fi + +if [[ -n "$developer_dir" ]]; then + cat >> "$pre_xcodeproj_bazelrc_dir/pre_xcodeproj.bazelrc" <