@@ -79,20 +79,21 @@ setup_quickstart_repo() {
79
79
# QUICKSTART_REPO is not set, so clone it.
80
80
quickstart_dir=" quickstart-ios"
81
81
if [[ -d " ${quickstart_dir} " ]]; then
82
- echo " Quickstart repository already exists at ${quickstart_dir} "
82
+ echo " Quickstart repository already exists at ${quickstart_dir} " >&2
83
83
else
84
- echo " Cloning quickstart repository into '${quickstart_dir} ' directory..."
84
+ echo " Cloning quickstart repository into '${quickstart_dir} ' directory..." >&2
85
85
# Do a partial, sparse clone to speed up CI. See
86
86
# https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone/
87
87
git clone --filter=blob:none --sparse https://github.com/firebase/quickstart-ios.git " ${quickstart_dir} "
88
88
fi
89
89
(
90
90
cd " ${quickstart_dir} "
91
- echo " Ensuring sparse checkout is set for ${sample_name} ..."
91
+ echo " Ensuring sparse checkout is set for ${sample_name} ..." >&2
92
92
# Checkout the sample and config directories.
93
93
git sparse-checkout set " ${sample_name} " config
94
94
)
95
95
fi
96
+ # Return the absolute path to the quickstart directory.
96
97
(cd " $quickstart_dir " && pwd)
97
98
}
98
99
@@ -149,13 +150,18 @@ main() {
149
150
local sample=" $1 "
150
151
local release_testing=" ${2-} "
151
152
152
- if [[ -n " ${release_testing} " && \
153
- " ${release_testing} " != " ${NIGHTLY_RELEASE_TESTING} " && \
154
- " ${release_testing} " != " ${PRERELEASE_TESTING} " ]]; then
155
- echo " Error: Invalid testing_mode: '${release_testing} '" >&2
156
- print_usage
157
- exit 1
158
- fi
153
+ # Validate release_testing argument.
154
+ case " $release_testing " in
155
+ " " | " ${NIGHTLY_RELEASE_TESTING} " | " ${PRERELEASE_TESTING} " )
156
+ # This is a valid value (or empty), so do nothing.
157
+ ;;
158
+ * )
159
+ # This is an invalid value.
160
+ echo " Error: Invalid testing_mode: '${release_testing} '" >&2
161
+ print_usage
162
+ exit 1
163
+ ;;
164
+ esac
159
165
160
166
# --- Environment Setup and Validation ---
161
167
# Enable trace mode if DEBUG is set to 'true'
@@ -200,15 +206,11 @@ main() {
200
206
fi
201
207
local project_file=" ${project_files[0]} "
202
208
203
- # The update script needs an absolute path to the project file.
204
- local absolute_project_file
205
- absolute_project_file=" $( cd " $( dirname " $project_file " ) " && pwd) /$( basename " $project_file " ) "
206
-
207
209
# NOTE: Uncomment below and replace `{BRANCH_NAME}` for testing a branch of
208
210
# the quickstart repo.
209
211
# (cd "$quickstart_dir"; git checkout {BRANCH_NAME})
210
212
211
- update_spm_dependency " $release_testing " " $absolute_project_file "
213
+ update_spm_dependency " $release_testing " " $project_file "
212
214
}
213
215
214
216
# Run the main function with all provided arguments.
0 commit comments