Skip to content

Instantly share code, notes, and snippets.

@docunext
Last active December 16, 2015 10:39
Show Gist options
  • Save docunext/5421383 to your computer and use it in GitHub Desktop.
Save docunext/5421383 to your computer and use it in GitHub Desktop.
Change RAILS_ENV to Rails.env
for i in app config lib test; do grep -rl RAILS_ENV $i | awk '{print "sed -ri \"s/RAILS_ENV/Rails.env/g\" " $1 }' > com.sh && sh com.sh && rm com.sh; done
for i in app config lib test; do grep -rl RAILS_ROOT $i | awk '{print "sed -ri \"s/RAILS_ROOT/Rails.root/g\" " $1 }' > com.sh && sh com.sh && rm com.sh; done
for i in app config lib test; do grep -rlE " $" $i | awk '{print "sed -ri \"s/\ +$//g\" " $1 }' > com.sh && sh com.sh && rm com.sh; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment