26 lines
548 B
Bash
Executable file
26 lines
548 B
Bash
Executable file
#!/bin/ash
|
|
|
|
set -e
|
|
|
|
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
|
|
echo "+ preparing database..."
|
|
./bin/rails db:prepare
|
|
echo "- preparing database done."
|
|
|
|
if [ -n "$ASSETS_PATH" ]; then
|
|
echo "+ copying assets..."
|
|
cp -nr public/* $ASSETS_PATH
|
|
echo "- copying assets done."
|
|
fi
|
|
|
|
bundle config
|
|
fi
|
|
|
|
# Execute the given or default command:
|
|
exec "${@}"
|
|
|