Skip to content

Commit

Permalink
tools/upgrade: Record commit ID of Flutter into pubspec.yaml
Browse files Browse the repository at this point in the history
Fixes #1118, or anyway the main part of it.

Upcoming commits will add a suite in tools/check that validates
this information, in case this line gets updated manually rather
than using this script.
  • Loading branch information
gnprice committed Dec 9, 2024
1 parent e6932fb commit 7b4312a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tools/upgrade
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,6 @@ deps: Update CocoaPods pods (tools/upgrade pod)
}

upgrade_flutter_local() {
local flutter_version_output versions flutter_version dart_sdk_version

check_no_uncommitted_or_untracked

# No check_pub_get_clean. This operates on a `flutter` you've
Expand All @@ -158,6 +156,10 @@ upgrade_flutter_local() {

# TODO upgrade Flutter to latest, rather than what's lying around

local flutter_commit
flutter_commit=$(git --git-dir="$(flutter_tree)"/.git rev-parse HEAD)

local flutter_version_output versions flutter_version dart_sdk_version
flutter_version_output=$(run_visibly flutter --version)
# shellcheck disable=SC2207 # output has controlled whitespace
versions=( $(echo -n "${flutter_version_output}" | perl -0ne '
Expand All @@ -178,7 +180,7 @@ upgrade_flutter_local() {

yaml_fragment="\
sdk: '>=${dart_sdk_version} <4.0.0'
flutter: '>=${flutter_version}'
flutter: '>=${flutter_version}' # ${flutter_commit}
" \
perl -i -0pe 's/^ sdk: .*\n flutter: .*\n/$ENV{yaml_fragment}/m' \
pubspec.yaml
Expand Down

0 comments on commit 7b4312a

Please sign in to comment.