Skip to content

Instantly share code, notes, and snippets.

@brasizza
Created October 25, 2024 11:59
Show Gist options
  • Save brasizza/a502ea11b934daeaa1c6a0eb3fcd4f46 to your computer and use it in GitHub Desktop.
Save brasizza/a502ea11b934daeaa1c6a0eb3fcd4f46 to your computer and use it in GitHub Desktop.
#!/bin/bash
FLAVOR=$1
if [ -z "$FLAVOR" ]; then
echo "No flavor provided. Usage: $0 [rede|stone|destaxa|default]"
exit 1
fi
# Remove diretórios antigos e limpe submódulos desnecessários
rm -rf ./pos*
# Remova submódulos do cache do Git
git rm --cached pos_package
rm -rf .git/modules/pos_package
# Desabilite rebase durante pull globalmente
git config --global pull.rebase false
# 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_android.git ./pos_package
;;
esac
git submodule update --init --recursive --force
flutter clean
flutter pub get
git reset
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment