#!/bin/bash FLAVOR=$1 if [ -z "$FLAVOR" ]; then echo "No flavor provided. Usage: $0 [rede|stone|destaxa|default]" exit 1 fi rm -rf ./pos_package rm -rf ./printer_gateway rm -rf ./epoc-nfc-system git rm --cached pos_package rm -rf .git/modules/pos_package git rm --cached epoc-nfc-system rm -rf .git/modules/epoc-nfc-system git rm --cached pos_package rm -rf .git/modules/pos_package git config --global pull.rebase false git submodule add -f https://git.epoc.com.br/epoc/packages-flutter/printer_gateway.git ./printer_gateway git submodule add -f https://git.epoc.com.br/epoc/packages-flutter/epoc-nfc-package.git ./epoc-nfc-system git rm --cached pos_package rm -rf .git/modules/pos_package # Define Git URL based on the flavor passed case "$FLAVOR" in rede) git submodule add -f https://git.epoc.com.br/epoc/packages-flutter/pos_rede.git ./pos_package ;; stone) git submodule add -f https://git.epoc.com.br/epoc/packages-flutter/pos_stone.git ./pos_package ;; destaxa) git submodule add -f https://git.epoc.com.br/epoc/packages-flutter/pos_destaxa.git ./pos_package ;; *) git submodule add -f https://git.epoc.com.br/epoc/packages-flutter/pos_stub.git ./pos_package ;; esac git submodule update --init --recursive --force flutter pub get