1
0
Fork 0

Added support for %curver comment tag

website
Mike Gerwitz 2012-05-05 23:51:59 -04:00
parent a25961a088
commit bd1ce2dad4
No known key found for this signature in database
GPG Key ID: F22BB8158EE30EAB
2 changed files with 7 additions and 3 deletions

View File

@ -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>

View File

@ -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'