-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathdmg.sh
executable file
·33 lines (29 loc) · 1.02 KB
/
dmg.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# dmg.sh
#!/bin/bash
# Check if the flavor argument is provided
if [ $# -eq 0 ]; then
echo "Usage: $0 <flavor>"
exit 1
fi
FLAVOR=$1
version=$(head -n 5 pubspec.yaml | tail -n 1 | cut -d ' ' -f 2)
appname=$(head -n 1 pubspec.yaml | cut -d ' ' -f 2)
echo "Building $appname version $version for $FLAVOR"
case $FLAVOR in
dev)
flutter build macos --release --flavor dev --dart-define-from-file env/dev.json -t lib/main.dart \
&& cp -r build/macos/Build/Products/Release/boorusama.app build/boorusama.app \
&& create-dmg --hdiutil-quiet build/${appname}-${version}-dev.dmg build/boorusama.app \
&& rm -rf build/boorusama.app
;;
prod)
flutter build macos --release --flavor prod --dart-define-from-file env/prod.json -t lib/main.dart \
&& cp -r build/macos/Build/Products/Release/boorusama.app build/boorusama.app \
&& create-dmg --hdiutil-quiet build/${appname}-${version}.dmg build/boorusama.app \
&& rm -rf build/boorusama.app
;;
*)
echo "Invalid flavor provided"
exit 1
;;
esac