Created
March 22, 2018 15:41
-
-
Save rwcarlsen/6ad3fdd69b99b621470f5a34b991f6df 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 | |
# run this script with one or more arguments that are the directories that hold the code files for | |
# the objects you want to update. | |
dirs=$@ | |
appname='YourAppName' | |
objs=' | |
PotentialAdvection | |
EFieldAdvection | |
CoeffParamDiffusion | |
... | |
' | |
actions=' | |
ConvDiffMetaAction meta_action | |
AddLotsOfAuxVariablesAction meta_action | |
... | |
' | |
for obj in $objs; do | |
find $dirs | grep "/${obj}\.C$" | xargs perl -0777 -i'' -pe 's/(template <>\nInputParameters\nvalidParams<(\w*)>\(\))/registerMooseObject\("'"$appname"'", \2\);\n\n\1/igs' | |
done | |
while read action task; do | |
find $dirs | grep "/${action}\.C$" | xargs perl -0777 -i'' -pe 's/(template <>\nInputParameters\nvalidParams<(\w*)>\(\))/registerMooseAction\("'"$appname"'", \2, "'"$task"'"\);\n\n\1/igs' | |
done <<< "$actions" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment