Last active
July 10, 2019 16:15
-
-
Save hattmarris/c18e15d0ddc7528bfe896887f3690c0a to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env bash | |
case $# in | |
2) DIR=.;SEARCH=$1;REPLACE=$2;; | |
3) DIR=$1;SEARCH=$2;REPLACE=$3;; | |
esac | |
echo "searching for string in $DIR for *.jsx files: $SEARCH" | |
echo "replacing with string in *.jsx files: $REPLACE" | |
find $DIR -type f \( -iname \*.jsx -o -iname \*.js \) | xargs sed -i '' "s/$SEARCH/$REPLACE/g" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment