Skip to content

Commit

Permalink
tools/upgrade [nfc]: Push check_have_cocoapods down into each step
Browse files Browse the repository at this point in the history
This will be convenient for adding a new step that doesn't require
CocoaPods.

The check is very fast, so unlike with check_pub_get_clean there's
no need to memoize the result.
  • Loading branch information
gnprice committed Jun 12, 2024
1 parent 8f1d563 commit bb688ad
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tools/upgrade
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ check_pub_get_clean() {

just_pod_update() {
[ -z "${opt_pod}" ] && return;
check_have_cocoapods

run_visibly pod update --project-directory=ios/
run_visibly pod update --project-directory=macos/
Expand All @@ -123,6 +124,7 @@ upgrade_pod() {
return
fi

check_have_cocoapods
check_no_uncommitted_or_untracked
check_pub_get_clean

Expand All @@ -138,6 +140,7 @@ deps: Update CocoaPods pods (tools/upgrade pod)
}

upgrade_pub() {
check_have_cocoapods
check_no_uncommitted_or_untracked
check_pub_get_clean

Expand Down Expand Up @@ -170,6 +173,7 @@ deps: Upgrade packages within constraints (tools/upgrade pub)
}

upgrade_pub_major() {
check_have_cocoapods
check_no_uncommitted_or_untracked
check_pub_get_clean

Expand Down Expand Up @@ -221,8 +225,6 @@ EOF
fi
}

check_have_cocoapods

divider_line='================================================================'

for step in "${opt_steps[@]}"; do
Expand Down

0 comments on commit bb688ad

Please sign in to comment.