Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
7 lines
279 B
Python
7 lines
279 B
Python
#!/usr/bin/env python3
|
|
"""usage: prov_commit.py PROVENANCE.json [TAG]: prints git_commit; with TAG exits 1 unless it starts with TAG."""
|
|
import json, sys
|
|
c = json.load(open(sys.argv[1]))["git_commit"]
|
|
print(c)
|
|
sys.exit(0 if len(sys.argv) < 3 or c.startswith(sys.argv[2]) else 1)
|