Skip to content

Commit 8f1d563

Browse files
committed
tools/upgrade: Add --no-pod
1 parent 8865901 commit 8f1d563

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

tools/upgrade

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,20 @@ The steps are:
3636
then upgrade pods to match. If there are any changes
3737
here, the resulting commit is only a draft and requires
3838
human editing and review.
39+
40+
Options:
41+
42+
--no-pod Skip running CocoaPods. This is convenient for
43+
drafting a branch on Linux.
3944
EOF
4045
}
4146

47+
opt_pod=y
4248
opt_steps=()
4349
while (( $# )); do
4450
case "$1" in
51+
--no-pod)
52+
opt_pod=; shift;;
4553
pod|pub|pub-major)
4654
opt_steps+=("$1"); shift;;
4755
--help) usage; exit 0;;
@@ -60,6 +68,8 @@ rootdir=$(git rev-parse --show-toplevel)
6068
cd "$rootdir"
6169

6270
check_have_cocoapods() {
71+
[ -z "${opt_pod}" ] && return;
72+
6373
if ! type pod >/dev/null; then
6474
echo >&2 "No \`pod\` command found."
6575
echo >&2
@@ -100,11 +110,19 @@ check_pub_get_clean() {
100110
}
101111

102112
just_pod_update() {
113+
[ -z "${opt_pod}" ] && return;
114+
103115
run_visibly pod update --project-directory=ios/
104116
run_visibly pod update --project-directory=macos/
105117
}
106118

107119
upgrade_pod() {
120+
if [ -z "${opt_pod}" ]; then
121+
echo >&2
122+
echo >&2 "pod update: WARNING: skipping because --no-pod"
123+
return
124+
fi
125+
108126
check_no_uncommitted_or_untracked
109127
check_pub_get_clean
110128

@@ -144,6 +162,11 @@ upgrade_pub() {
144162
git commit -a -m "\
145163
deps: Upgrade packages within constraints (tools/upgrade pub)
146164
"
165+
166+
if [ -z "${opt_pod}" ]; then
167+
echo >&2
168+
echo >&2 "flutter pub upgrade: WARNING: Podfile.lock files may be out of date because --no-pod"
169+
fi
147170
}
148171

149172
upgrade_pub_major() {
@@ -191,6 +214,11 @@ To finish the upgrade:
191214
If several unrelated packages were upgraded, and any of them require
192215
changes in our code, consider upgrading them in separate commits.
193216
EOF
217+
218+
if [ -z "${opt_pod}" ]; then
219+
echo >&2
220+
echo >&2 "flutter pub upgrade --major-versions: WARNING: Podfile.lock files may be out of date because --no-pod"
221+
fi
194222
}
195223

196224
check_have_cocoapods

0 commit comments

Comments
 (0)