a11yist/bin/entrypoint

23 lines
493 B
Text
Raw Normal View History

#!/bin/bash
set -e
2024-07-20 16:52:12 +02:00
echo "1: ${1}"
echo "2: ${2}"
if [ -f tmp/pids/server.pid ]; then
rm tmp/pids/server.pid
fi
# Make the if statement match any invocation of the "rails server" command
if [[ "${1}" == *rails ]] && ([ "${2}" == "server" ] || [ "${2}" == "s" ]); then
if [ ! -f /app/no_migrate ] && [ ! -v NO_MIGRATE ]; then
echo "+ preparing database..."
./bin/rails db:prepare
echo "- preparing database done."
fi
fi
# Execute the given or default command:
exec "${@}"