Skip to content

Commit

Permalink
test version [a1]
Browse files Browse the repository at this point in the history
Signed-off-by: Mic Bowman <[email protected]>
  • Loading branch information
cmickeyb committed Oct 14, 2024
1 parent 491ffb3 commit 651f30c
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions bin/get_version
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,25 @@ import os
import pathlib
import subprocess

pdo_source_root = pathlib.Path(__file__).parent.parent
default_version_file = pdo_source_root / 'VERSION'
pdo_source_root=pathlib.Path(__file__).parent.parent
version_file = pdo_source_root / 'VERSION'

parser = argparse.ArgumentParser()

parser.add_argument(
'--version-file', '-v',
help='File where version information is stored',
type=str,
default=default_version_file)
type=str)

options = parser.parse_args()

if options.version_file :
version_file = pathlib.Path(options.version_file)
pdo_source_root = version_file.parent

# the version file is a tab separated list of version numbers and git commit hashes in reverse
# order (newest is at the top of the file)
with open(options.version_file, 'r') as vf :
with open(version_file, 'r') as vf :
(version, commit, *rest) = vf.readline().strip().split('\t')

# the version is of the form x.y.z, there may be an optional 'v' at the beginning of the version
Expand Down

0 comments on commit 651f30c

Please sign in to comment.