Created
September 30, 2019 08:27
-
-
Save bjornbjorn/e0198072963fee92e594196387de726f to your computer and use it in GitHub Desktop.
Flutter "flavoring"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
flavorName=$1; | |
[ "$flavorName" == "" ] && { echo "Usage: $0 <client name>"; exit 1; } | |
if [ -d "clients/$flavorName" ]; then | |
echo "Client $flavorName found .." | |
plutil -replace CFBundleIdentifier -string no.lastfriday.heyho.rebusloep.$flavorName ios/Runner/Info.plist | |
cp clients/$flavorName/LaunchScreen.storyboard ios/Runner/Base.lproj/ | |
sh clients/$flavorName/switch.sh | |
flutter packages pub run flutter_launcher_icons:main -f clients/$flavorName/icons.yaml | |
rsync -av --progress android/app/src/main/res android/app/src/$flavorName/ --exclude values | |
# The flutter_launcher_icons package overwrites the default icons since it does not have support for flavoring yet, so we revert to the original ones after copying | |
git checkout -- android/app/src/main/res | |
rsync -av --progress clients/$flavorName/assets/. assets/ | |
else | |
echo "ERR: Client / flavorName $flavorName not found!" | |
fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment