Created
March 31, 2017 06:14
-
-
Save rrika/6b0948a4b7310e1ef39143364aa44c07 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
while ! ./_/build.sh 2> _/build.log; do | |
if [[ $(grep "No such file or directory" _/build.log) =~ .*error..(.*)..No.such.* ]]; then | |
missing=${BASH_REMATCH[1]} | |
echo "Adding file" $missing | |
mkdir -p $(dirname _missing/$missing) | |
touch _missing/$missing | |
elif [[ $(grep "was not declared in this scope" _/build.log) =~ .*error..‘([A-Z0-9_]*)’.was.not.* ]]; then | |
missing=${BASH_REMATCH[1]} | |
echo "Adding constant" $missing | |
echo "#define $missing $(wc -l < _missing/constants.h)" >> _missing/constants.h | |
elif [[ $(grep "does not name a type" _/build.log) =~ .*error..‘(.*)’.does.not.* ]]; then | |
missing=${BASH_REMATCH[1]} | |
echo "Adding struct" $missing | |
echo "struct $missing {};" >> _missing/structs.h | |
elif [[ $(grep "use of enum" _/build.log) =~ .*enum.‘(.*)’.without.* ]]; then | |
missing=${BASH_REMATCH[1]} | |
echo "Adding enum" $missing | |
echo "enum $missing {};" >> _missing/enums.h | |
else | |
echo "Can't continue" | |
exit 0 | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment