File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515
1616echo " $result "
1717printf " \e[32;1m%s\e[0m\n" ' Finished running dart format.'
18+
19+ # Get the commit message.
20+
21+ COMMIT_MSG=$( git log -1 --pretty=%B)
22+
23+ # 20260123 gjw Check if the commit message starts with 'Bump version'
24+ # If it does then run `make versions` to update the version in any
25+ # files that require updating, based on the version from pubspec.yaml.
26+ # Then add any updated files to the commit. I add specific files
27+ # rather than using `.` just to avoid possibly adding things I was not
28+ # planning to. This way we always update, for example, the snap
29+ # version when we 'Bump version', avoiding missing this step, so the
30+ # installer builds that 'Bump version' triggers will get the correct
31+ # versions.
32+
33+ if [[ $COMMIT_MSG == Bump\ version* ]]; then
34+ printf " \e[33;1m%s\e[0m\n" ' Update versions.'
35+
36+ make versions
37+ git add snap/snapcraft.yaml
38+
39+ printf " \e[32;1m%s\e[0m\n" ' Finished updating versions.'
40+
41+ fi
Original file line number Diff line number Diff line change 77#
88# If this script exits with a non-zero status nothing will be pushed.
99
10- PVER=$( egrep ' ^version:' pubspec.yaml | cut -d' ' -f2 | cut -d' +' -f1)
11-
12- if [ -d snap ]; then
13- printf " \e[33;1m%s\e[0m\n" ' Update snap version.'
14- perl -pi -e " s|^version:.*|version: ${PVER} |" snap/snapcraft.yaml;
15- fi
16-
1710# Flutter Analyze
1811
1912printf " \e[33;1m%s\e[0m\n" ' Running flutter analyze.'
Original file line number Diff line number Diff line change 1313 types : [opened, reopened, synchronize]
1414
1515env :
16- FLUTTER_VERSION : ' 3.38.5 '
16+ FLUTTER_VERSION : ' 3.38.9 '
1717
1818jobs :
1919
Original file line number Diff line number Diff line change @@ -23,15 +23,17 @@ show_help() {
2323# Function to cleanse lines.
2424
2525cleanse_lines () {
26- # Remove:
27- # empty lines
28- # comment only lines
29- # import/library/@override
30- # lines that start with }, ) or ]
31- # lines that consist of '? [' or ': ['
32- # begins a parameter list, like ` names: [`
33- #
34- awk ' NF && !/^\s*\/\/|^\s*(import|library|@override)|^\s*[})\]]|^\s*(\?|:) \[|\s*\w*: \[/' " $1 "
26+ sed ' 1d' " $1 " |
27+ grep -v ' ^$' | # Remove empty lines
28+ grep -v ' ^[[:space:]]*//' | # Remove comment only lines
29+ grep -v ' ^\(import\|library\)' | # Remove library and import statements
30+ grep -v ' ^\s*@' | # Remove directives
31+ grep -v ' ^\s*[\}\)]' | # Remove linest that start with a bracket
32+ grep -v ' ^\s*\]' | # Needed this as special case
33+ grep -v ' ^\s*(\?|:) \[' | # Remove lines that consist of '? [' or ': ['
34+ grep -v ' \s*\w*: \[' | # Remove parameter list lines like ` names: [`
35+ grep -v " ^\s*['][^']*[']" | # Remove lines that are only a string.
36+ cat
3537}
3638
3739wc_cleanse_lines () {
You can’t perform that action at this time.
0 commit comments