Last active
October 20, 2015 17:24
-
-
Save kevinvdburgt/67ee16a801707a5b6372 to your computer and use it in GitHub Desktop.
VQMod transpiler supporting includes
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 | |
INPUT="input.xml" | |
OUTPUT="output.xml" | |
while read; do | |
[[ "$REPLY" =~ ^(.*)@include\[([^\]]*)\](.*) ]] && | |
REPLY=$(sed "s/^/${BASH_REMATCH[1]}/" "${BASH_REMATCH[2]}")${BASH_REMATCH[3]} | |
echo "$REPLY" | |
done < $INPUT > $OUTPUT |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<modification> | |
<id>Testing</id> | |
<version>0.0.1</version> | |
<vqmver required="true">2.5.0</vqmver> | |
<author><![CDATA[Dragon707]]></author> | |
<file name="template/a.tpl"> | |
<operation error="log"> | |
<search position="before"><![CDATA[ | |
whooo | |
]]></search> | |
<add><![CDATA[ | |
@include[src/a.php] | |
]]></add> | |
</operation> | |
</file> | |
<file name="template/b.tpl"> | |
<operation error="log"> | |
<search position="before"><![CDATA[ | |
wheee | |
]]></search> | |
<add><![CDATA[ | |
@include[src/b.php] | |
]]></add> | |
</operation> | |
</file> | |
</modification> |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<modification> | |
<id>Testing</id> | |
<version>0.0.1</version> | |
<vqmver required="true">2.5.0</vqmver> | |
<author><![CDATA[Dragon707]]></author> | |
<file name="template/a.tpl"> | |
<operation error="log"> | |
<search position="before"><![CDATA[ | |
whooo | |
]]></search> | |
<add><![CDATA[ | |
<?php | |
echo '123'; | |
?> | |
]]></add> | |
</operation> | |
</file> | |
<file name="template/b.tpl"> | |
<operation error="log"> | |
<search position="before"><![CDATA[ | |
wheee | |
]]></search> | |
<add><![CDATA[ | |
<?php print_r($_SERVER); ?> | |
]]></add> | |
</operation> | |
</file> | |
</modification> |
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
<?php | |
echo '123'; | |
?> |
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
<?php print_r($_SERVER); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment