Sanmill/flutter-init.sh

26 lines
611 B
Bash
Executable File

#!/bin/bash
ENV_FILE_PATH=assets/files
ENV_FILE=$ENV_FILE_PATH/environment_variables.txt
GEN_FILE_PATH=lib/generated
FLUTTER_VERSION_FILE=$GEN_FILE_PATH/flutter_version.dart
cd src/ui/flutter_app || exit
flutter config --no-analytics
flutter pub get
flutter pub global activate intl_utils
flutter --no-color pub global run intl_utils:generate
mkdir -p $GEN_FILE_PATH || true
echo "const Map<String, String> flutterVersion =" > $FLUTTER_VERSION_FILE
flutter --version --machine >> $FLUTTER_VERSION_FILE
echo ";" >> $FLUTTER_VERSION_FILE
mkdir -p $ENV_FILE_PATH || true
touch $ENV_FILE
export > $ENV_FILE