Prefer bin/rails when available

This commit is contained in:
Andrew Tomaka 2023-04-07 19:34:44 -04:00
parent 289cbfe53a
commit e992ac389d
Signed by: atomaka
GPG key ID: 61209BF70A5B18BE
2 changed files with 9 additions and 1 deletions

View file

@ -8,7 +8,7 @@ alias awsi="aws sts get-caller-identity"
alias awsp="aws-profile" alias awsp="aws-profile"
alias b="bundle" alias b="bundle"
alias be="bundle exec" alias be="bundle exec"
alias bea="bundle exec rails" alias bea="run-rails"
alias ber="bundle exec rake" alias ber="bundle exec rake"
alias bet="test-rails" alias bet="test-rails"
alias c="clear" alias c="clear"

View file

@ -90,6 +90,14 @@ function run {
fi fi
} }
function run-rails {
if [ -f bin/rails ]; then
bin/rails $@
else
bundle exec rails
fi
}
function test-rails { function test-rails {
if bundle exec rspec --help > /dev/null 2>&1; then if bundle exec rspec --help > /dev/null 2>&1; then
if [ -d spec ]; then if [ -d spec ]; then