#!/bin/bash
echo "COMMERCE_BACKEND is set to: $COMMERCE_BACKEND"

if [[ "$COMMERCE_BACKEND" == "linux" ]]; then
    echo "Copying all netcore dlls from /sharedvolume"
    cp -v /sharedvolume/netcore/*.dll /app
else
    # default to the current behavior
    echo "Copying all net48 dlls from /sharedvolume"
    cp -v /sharedvolume/*.dll /app
fi

echo "Running the DatabaseUpdater"
./DatabaseUpdater

return_code=$?
if [ $return_code -ne 0 ]; then
    echo "There was an issue while running the DatabaseUpdater."
    exit $return_code
fi
