Package workstation tools, reuse emulator sessions, and derive build versions
This commit is contained in:
Executable
+18
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Print the FDS version derived from release tags or a Git source export."""
|
||||
import argparse
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
from fds_version import ROOT, cargo, version
|
||||
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument('--root', type=Path, default=ROOT)
|
||||
parser.add_argument('--cargo', action='store_true', help='emit Cargo build metadata and change tracking')
|
||||
args = parser.parse_args()
|
||||
try:
|
||||
if args.cargo:
|
||||
cargo(args.root.resolve())
|
||||
else:
|
||||
print(version(args.root))
|
||||
except (OSError, ValueError, subprocess.CalledProcessError) as error:
|
||||
parser.exit(1, f'Cannot determine FDS version: {error}\n')
|
||||
Reference in New Issue
Block a user