Added support for %curver comment tag
parent
a25961a088
commit
bd1ce2dad4
|
@ -1,6 +1,6 @@
|
||||||
<p>
|
<p>
|
||||||
<span class="release-current">
|
<span class="release-current">
|
||||||
Current Release: <span class="version">0.1.0</span>
|
Current Release: <span class="version"><!--%curver--></span>
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
|
|
|
@ -18,11 +18,15 @@
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
##
|
##
|
||||||
|
|
||||||
# currently, this only replaces %inc commands with the file contents
|
curver="$( git tag -l | tail -n1 )"
|
||||||
|
|
||||||
|
# TODO: Both sed and gawk are unnecessary; it was just the most convenient
|
||||||
|
# solution
|
||||||
gawk '
|
gawk '
|
||||||
match( $0, /^ *<!--%inc (.*?) *--> *$/, arr ) {
|
match( $0, /^ *<!--%inc (.*?) *--> *$/, arr ) {
|
||||||
system( "cat " arr[1] )
|
system( "cat " arr[1] )
|
||||||
next
|
next
|
||||||
}
|
}
|
||||||
{ print }
|
{ print }
|
||||||
'
|
' \
|
||||||
|
| sed 's/<!--%curver-->/'$curver'/g'
|
||||||
|
|
Loading…
Reference in New Issue