Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # get a list of files which contain "require" AND "spec_helper" on a single line
- # excluding spec/rails_helper.rb (we want "require 'spec_helper'" to exist here)
- declare -a files=$(git grep -E "require.*spec_helper" | cut -d ':' -f 1 | grep -v 'spec/rails_helper.rb')
- # loop through files and replace "spec_helper" with "rails_helper"
- for i in $files; do
- sed -i '' -e 's/spec_helper/rails_helper/' $i
- done
Add Comment
Please, Sign In to add comment