python-specfile/plans/git_reference.py
Packit 2d036948fd [packit] 0.7.0 upstream release
Upstream tag: 0.7.0
Upstream commit: e121363b

Signed-off-by: Packit <hello@packit.dev>
2022-10-07 14:32:47 +00:00

14 lines
358 B
Python

#!/usr/bin/python
import subprocess
from pathlib import Path
import fmf
tree_root = Path.cwd().absolute()
node = fmf.Tree(tree_root).find("/plans")
with node as data:
data["discover"]["url"] = "https://github.com/packit/specfile.git"
data["discover"]["ref"] = (
subprocess.check_output(["git", "rev-parse", "HEAD"]).decode().strip()
)