Skip to content

Commit 3467cfc

Browse files
committed
review
1 parent 4eb43b3 commit 3467cfc

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

scripts/setup_quickstart_spm.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,15 @@ ENVIRONMENT VARIABLES:
4949
If not set, the script will clone it from GitHub.
5050
Example: QUICKSTART_REPO=/path/to/quickstart-ios $(basename "$0") authentication
5151
52+
QUICKSTART_BRANCH: Optional. The branch to checkout in the quickstart repo.
53+
Defaults to the repo's default branch.
54+
Example: QUICKSTART_BRANCH=my-feature-branch $(basename "$0") authentication
55+
5256
BYPASS_SECRET_CHECK: Optional. Set to "true" to bypass the CI secret check for local runs.
5357
Example: BYPASS_SECRET_CHECK=true $(basename "$0") authentication
58+
59+
DEBUG: Optional. Set to "true" to enable shell trace mode (`set -x`).
60+
Example: DEBUG=true $(basename "$0") authentication
5461
EOF
5562
}
5663

@@ -93,6 +100,17 @@ setup_quickstart_repo() {
93100
git sparse-checkout set "${sample_name}" config
94101
)
95102
fi
103+
104+
# If a branch is specified, check it out.
105+
if [[ -n "${QUICKSTART_BRANCH:-}" ]]; then
106+
echo "Checking out quickstart branch: ${QUICKSTART_BRANCH}" >&2
107+
(
108+
cd "${quickstart_dir}"
109+
git fetch
110+
git checkout "${QUICKSTART_BRANCH}"
111+
)
112+
fi
113+
96114
# Return the absolute path to the quickstart directory.
97115
(cd "$quickstart_dir" && pwd)
98116
}

0 commit comments

Comments
 (0)