Skip to content

Commit 148185e

Browse files
committed
Added the scripts folder
1 parent fb12781 commit 148185e

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

scripts/dart_publish.sh

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/bin/bash
2+
3+
# if the `dart` folder is not in the current path, try to move to the parent folder
4+
if [ ! -d "dart" ]; then
5+
cd ..
6+
fi
7+
8+
# if the `dart` folder is not in the current path, exit
9+
if [ ! -d "dart" ]; then
10+
echo "Could not find the 'dart' folder"
11+
exit 1
12+
fi
13+
14+
# enter the `dart` folder
15+
cd dart
16+
17+
dart analyze
18+
19+
# if analysis fails, exit
20+
if [ $? -ne 0 ]; then
21+
echo "Please check the analysis errors"
22+
exit 1
23+
fi
24+
25+
# publish in dry-run
26+
dart pub publish --dry-run
27+
28+
# if dry-run fails, exit
29+
if [ $? -ne 0 ]; then
30+
echo "Please check the dry-run errors"
31+
exit 1
32+
fi
33+
34+
# If we get here, everything is fine, so publish
35+
dart pub publish

0 commit comments

Comments
 (0)