Skip to content

Commit

Permalink
Use bikeshed git commit as version string.
Browse files Browse the repository at this point in the history
Since there is no packaged release of bikeshed (i.e., you have to
check out the repository to use it), this is the best way to record
the version of bikeshed used to produce a given output.
  • Loading branch information
szager-chromium authored and tabatkins committed Nov 15, 2016
1 parent faabb3e commit 902d95f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions bikeshed/boilerplate.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# -*- coding: utf-8 -*-
from __future__ import division, unicode_literals
import re
import copy
from collections import defaultdict
import copy
import os
import re
import subprocess
from .messages import *
from .htmlhelpers import *
from .DefaultOrderedDict import DefaultOrderedDict
Expand All @@ -13,8 +15,9 @@ def addBikeshedVersion(doc):
if "generator" not in doc.md.boilerplate:
return
head = find("head", doc)
bikeshedVersion = subprocess.check_output(["git", "rev-parse", "HEAD"], cwd=os.path.dirname(__file__)).rstrip()
appendChild(head,
E.meta({"name": "generator", "content": "Bikeshed 1.0.0"}))
E.meta({"name": "generator", "content": "Bikeshed version %s" % bikeshedVersion}))


def addHeaderFooter(doc):
Expand Down

0 comments on commit 902d95f

Please sign in to comment.