practice doing this
at main 203 B view raw
1#!/bin/bash -e 2 3# If running the rails server then create or migrate existing database 4if [ "${@: -2:1}" == "./bin/rails" ] && [ "${@: -1:1}" == "server" ]; then 5 ./bin/rails db:prepare 6fi 7 8exec "${@}"