File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -90,3 +90,13 @@ git_base_commit() {
90
90
git_changed_files () {
91
91
git diff --name-only --diff-filter=d " $@ "
92
92
}
93
+
94
+ # Note that this assumes ONE submodule. If we ever have more than one,
95
+ # we'll need to generalize this.
96
+ submodule_is_clean ()
97
+ {
98
+ # first character of every line status indicates the status of the
99
+ # submodule. If there is a space, it means the submodule is clean
100
+ # and initiated.
101
+ git submodule status | grep -q " ^ "
102
+ }
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
set -euo pipefail
3
3
4
+ this_dir=${BASH_SOURCE[0]%/* }
5
+
6
+ # shellcheck source=tools/lib/git.sh
7
+ . " ${this_dir} " /lib/git.sh
8
+
9
+
4
10
# One-time setup to let git submodule + flutter SDK know that we're
5
11
# using the main channel (main branch).
12
+ # We should do a quick check that there's no changes.
13
+ if ! submodule_is_clean; then
14
+ echo >&2 " There are changes in the submodule or it is not initialized."
15
+ echo >&2 " Please run 'git submodule update --init' then run this script again."
16
+ exit 1
17
+ fi
18
+
6
19
git -C vendor/flutter checkout -B main HEAD
You can’t perform that action at this time.
0 commit comments