INNER CODE UNIT · Python

run

spantaleev/matrix-docker-ansible-deploy · bin/molecule-select-roles.py:45

    def run(self, *args, input=None):
        return subprocess.run(
            ["git", *args], cwd=self.root, input=input, stdout=subprocess.PIPE,
            stderr=subprocess.PIPE, check=True,
        ).stdout

    def commit(self, ref):
        return self.run("rev-parse", "--verify", "--end-of-options", f"{ref}^{{commit}}").decode().strip()

    def snapshot(self, ref):
        entries = {}
        for entry in self.run("ls-tree", "-rz", ref, "--", "roles/custom", "molecule-shared").split(b"\0"):
            if not entry:
                continue
            metadata, path = entry.decode().split("\t", 1)
            mode, kind, oid = metadata.split()
            if path.startswith("molecule-shared/") or "/molecule/" in path:
                if kind != "blob":

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…