#!/bin/bash

function bundle-android {
  echo ""
  echo "bundle - Android"
  echo ""

  react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output ./android/app/src/main/assets/main.jsbundle
}


function bundle-ios {
  echo ""
  echo "bundle - iOS"
  echo ""

  react-native bundle --platform ios --dev false --entry-file index.ios.js --bundle-output ./ios/main.jsbundle
}


if [ "$1" == "android" ]; then
  bundle-android
elif [ "$1" == "ios" ]; then
  bundle-ios
else
  echo "Bundling for both platforms."
  bundle-ios
  bundle-android
fi