Skip to content

Commit d3489ea

Browse files
committed
Merge branch 'dev' of https://github.com/anusii/solidui into tony/154_download_files_from_other_app_folders
2 parents 9f04472 + c0868d1 commit d3489ea

4 files changed

Lines changed: 36 additions & 17 deletions

File tree

.githooks/pre-commit

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,27 @@ fi
1515

1616
echo "$result"
1717
printf "\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

.githooks/pre-push

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,6 @@
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

1912
printf "\e[33;1m%s\e[0m\n" 'Running flutter analyze.'

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ on:
1313
types: [opened, reopened, synchronize]
1414

1515
env:
16-
FLUTTER_VERSION: '3.38.5'
16+
FLUTTER_VERSION: '3.38.9'
1717

1818
jobs:
1919

support/loc.sh

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,17 @@ show_help() {
2323
# Function to cleanse lines.
2424

2525
cleanse_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

3739
wc_cleanse_lines() {

0 commit comments

Comments
 (0)