Created
July 6, 2017 07:58
-
-
Save DDR0/55735b95835f7f488db56ca2e1cef94b to your computer and use it in GitHub Desktop.
This file contains 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
#!/bin/bash | |
#Fix babel compilation error; --plugins transform-class-properties likes to make global functions which overwrite each other if you have two files with class properties. | |
#This should be fixed by using webpack. See https://github.com/markerikson/react-redux-links/blob/master/webpack-tutorials.md | |
set -eu | |
set -o pipefail | |
MODULENAME=$(echo $1 | perl -lne 's/([^\/]*?)\.// or next; s/\s.*//; print $1') #extract the filename from the path | |
perl -pi.bak -e "s|_initialiseProps|_initialiseProps_in_${MODULENAME//-/_}|g" $1 && rm $1.bak #rename all occurences of _initialiseProps, appending _in_«file_name» |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment