Skip to content

Commit 7b4312a

Browse files
committed
tools/upgrade: Record commit ID of Flutter into pubspec.yaml
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.
1 parent e6932fb commit 7b4312a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tools/upgrade

+5-3
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,6 @@ deps: Update CocoaPods pods (tools/upgrade pod)
146146
}
147147

148148
upgrade_flutter_local() {
149-
local flutter_version_output versions flutter_version dart_sdk_version
150-
151149
check_no_uncommitted_or_untracked
152150

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

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

159+
local flutter_commit
160+
flutter_commit=$(git --git-dir="$(flutter_tree)"/.git rev-parse HEAD)
161+
162+
local flutter_version_output versions flutter_version dart_sdk_version
161163
flutter_version_output=$(run_visibly flutter --version)
162164
# shellcheck disable=SC2207 # output has controlled whitespace
163165
versions=( $(echo -n "${flutter_version_output}" | perl -0ne '
@@ -178,7 +180,7 @@ upgrade_flutter_local() {
178180

179181
yaml_fragment="\
180182
sdk: '>=${dart_sdk_version} <4.0.0'
181-
flutter: '>=${flutter_version}'
183+
flutter: '>=${flutter_version}' # ${flutter_commit}
182184
" \
183185
perl -i -0pe 's/^ sdk: .*\n flutter: .*\n/$ENV{yaml_fragment}/m' \
184186
pubspec.yaml

0 commit comments

Comments
 (0)