INNER CODE UNIT · Python

run

CyrilPeng/Venera-Next · windows/build.py:26

def run(command):
    executable = shutil.which(command[0])
    if executable is None:
        raise FileNotFoundError(command[0])
    subprocess.run([executable, *command[1:]], check=True)


def read_version():
    content = (ROOT / "pubspec.yaml").read_text(encoding="utf-8")
    match = re.search(r"^version:\s*([^\s]+)", content, re.MULTILINE)
    if match is None:
        raise RuntimeError("pubspec.yaml does not contain a version field")
    return match.group(1).split("+", 1)[0]


def require_non_empty_file(path):
    if not path.is_file():
        raise FileNotFoundError(path)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…