Last active
March 3, 2024 11:49
-
-
Save DevotionGeo/953a7bde789369400cab840bfd7dbcf4 to your computer and use it in GitHub Desktop.
Alias `rails` to `bin/rails` only inside a Rails directory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Alias `rails` to `bin/rails` only inside a Rails directory | |
rails() { | |
if [ -n "$(find . -maxdepth 1 -name bin -type d -exec test -e '{}/rails' ';' -print -quit)" ] && [ -e Gemfile ]; then | |
bin/rails "$@" | |
else | |
command rails "$@" | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment