github.com/mgoltzsche/ctnr@v0.7.1-alpha/contrib/replace-code.sh (about)

     1  #!/bin/sh
     2  
     3  [ $# -eq 2 ] || (echo "Usage: $0 PATTERN REPLACESTR"; false) || exit 1
     4  
     5  escExpr() {
     6  	echo "$1" | sed 's/\//\\\//g'
     7  }
     8  
     9  find . -type f -not \( -path './.git/*' -o -path './vendor/*' -o -path './build/*' \) \
    10  	-exec sed -i "s/$(escExpr "$1")/$(escExpr "$2")/g" {} +