File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ result=$( dart format .)
4+ exitCode=$? # If the exitCode is zero, then command executed successfully.
5+
6+ if [ $exitCode -ne 0 ]; then
7+ echo " $result "
8+ echo " Dart format found issues, please fix them."
9+ exit 1
10+ fi
11+ echo " Finished running dart format command."
12+
13+ # ###############################################################
14+
15+ result=$( dart analyze .)
16+ exitCode=$? # If the exitCode is zero, then command executed successfully.
17+
18+ if [ $exitCode -ne 0 ]; then
19+ echo " $result "
20+ fi
21+ echo " Finished running dart analyze command."
22+
23+ # ###############################################################
24+
25+ # Run `dart dry --apply` to auto-fix basic issues.
26+ result=$( dart fix --apply)
27+ exitCode=$?
28+
29+ # Adding the files updated by `dart fix` command to git.
30+ git add .
31+
32+ echo " $result "
33+
34+ if [ $exitCode -ne 0 ]; then
35+ echo " dart fix command failed to execute."
36+ exit 1
37+ fi
38+ echo " Finished running dart fix command."
You can’t perform that action at this time.
0 commit comments