Something went wrong. Try again.
Repository hosting the source for Reverie Projects packs!
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435"""Helpers shared by the Tangled CI scripts."""
import osimport subprocessimport sysfrom pathlib import Path
PACK_CATEGORIES = ("modpacks", "datapacks", "resourcepacks")
def packwand_bin() -> Path: """Absolute path to the Packwand CLI built by build_packwand.py.""" return Path(os.environ.get("PACKWAND_BIN", "packwand-bin/packwand")).resolve()
def run(*cmd: str | Path, capture: bool = False) -> subprocess.CompletedProcess[str]: """Run a command, raising CalledProcessError on failure.""" return subprocess.run([str(c) for c in cmd], check=True, text=True, capture_output=capture)
def succeeds(*cmd: str | Path) -> bool: """Run a command and report whether it exited 0, without raising.""" return subprocess.run([str(c) for c in cmd]).returncode == 0
def git_output(*args: str) -> str: return run("git", *args, capture=True).stdout.strip()
def require_env(name: str, hint: str | None = None) -> str: value = os.environ.get(name) if not value: sys.exit(f"{name} is not set" + (f"; {hint}" if hint else "")) return value