a11yist/bin/entrypoint

26 lines
532 B
Text
Raw Normal View History

2024-09-05 22:54:38 +02:00
#!/bin/ash
set -e
2024-07-20 16:52:12 +02:00
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
2024-09-05 22:54:38 +02:00
echo "+ preparing database..."
./bin/rails db:prepare
echo "- preparing database done."
2024-09-05 22:54:38 +02:00
if [ -n "$ASSETS_PATH" ]; then
echo "+ copying assets..."
cp -nr public/* $ASSETS_PATH
echo "- copying assets done."
fi
2024-09-05 22:54:38 +02:00
fi
# Execute the given or default command:
exec "${@}"