diff options
author | Marc Cornellà <hello@mcornella.com> | 2022-03-07 15:20:03 +0100 |
---|---|---|
committer | Marc Cornellà <hello@mcornella.com> | 2022-03-07 22:37:04 +0100 |
commit | 47d313c90409f63ee6b06c65f2372bbf847c106b (patch) | |
tree | 4fe8ca713a33e18238348ff1365c0c05fe0d0f17 /plugins/rails/rails.plugin.zsh | |
parent | 3075d0c0ab823fbf3f52e9dfa33edd4be70f4679 (diff) | |
download | zsh-47d313c90409f63ee6b06c65f2372bbf847c106b.tar.gz zsh-47d313c90409f63ee6b06c65f2372bbf847c106b.tar.bz2 zsh-47d313c90409f63ee6b06c65f2372bbf847c106b.zip |
chore(rails): fix comments and docs
Diffstat (limited to 'plugins/rails/rails.plugin.zsh')
-rw-r--r-- | plugins/rails/rails.plugin.zsh | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/plugins/rails/rails.plugin.zsh b/plugins/rails/rails.plugin.zsh index f2b0f8293..e724bffc4 100644 --- a/plugins/rails/rails.plugin.zsh +++ b/plugins/rails/rails.plugin.zsh @@ -1,3 +1,4 @@ +# rails command wrapper function _rails_command () { if [ -e "bin/stubs/rails" ]; then bin/stubs/rails $@ @@ -12,28 +13,31 @@ function _rails_command () { fi } +alias rails='_rails_command' +compdef _rails_command=rails + +# rake command wrapper function _rake_command () { if [ -e "bin/stubs/rake" ]; then bin/stubs/rake $@ elif [ -e "bin/rake" ]; then bin/rake $@ - elif type bundle &> /dev/null && ([ -e "Gemfile" ] || [ -e "gems.rb" ]); then + elif type bundle &> /dev/null && [[ -e "Gemfile" || -e "gems.rb" ]]; then bundle exec rake $@ else command rake $@ fi } -alias rails='_rails_command' -compdef _rails_command=rails - alias rake='_rake_command' compdef _rake_command=rake +# Log aliases alias devlog='tail -f log/development.log' alias prodlog='tail -f log/production.log' alias testlog='tail -f log/test.log' +# Environment settings alias -g RED='RAILS_ENV=development' alias -g REP='RAILS_ENV=production' alias -g RET='RAILS_ENV=test' |