echo "Copying MobileFirst configuration file for iOS"
set PLUGIN_DIR= %cd%
set BASE_DIR= %cd%\..\..
echo "Plugin dir is " 
echo %PLUGIN_DIR%
echo "Base dir is " 
echo %BASE_DIR%

find /c "include ':react-native-bridge'" %BASE_DIR%\android\settings.gradle
if %errorlevel% equ 1 goto notfound
echo "Skipping copying of internal dependencies"
goto done
:notfound
echo "Adding internal dependencies"
copy /b %BASE_DIR%\android\settings.gradle + scripts\bridge.settings %BASE_DIR%\android\settings.gradle
:done

echo "Copying MobileFirst configuration file for Android"
if exist "%BASE_DIR%\android\app\src\main\assets\mfpclient.properties" (
    echo "MFP Server Configuration file already exists."
) else (
    echo "MFP Server Configuration file doesn't exist, creating one now."
    mkdir %BASE_DIR%\android\app\src\main\assets
    xcopy -E %PLUGIN_DIR%\android\src\main\assets %BASE_DIR%\android\app\src\main\assets
)

echo "Post installation complete"
