fixed bug in build-pacman-repo

This commit is contained in:
Sebastian Rust
2022-07-10 13:17:53 +02:00
parent 3b3c9ef51c
commit fc7ebde56f
2 changed files with 3 additions and 86 deletions

View File

@@ -20,7 +20,7 @@ def update(c):
@task
def addyaml(c, directory):
f = "./build-pacman-repo.yaml"
with open(f, "r+") as stream:
with open(f, "r") as stream:
data = yaml.safe_load(stream)
exists = [x["directory"] == directory for x in data["members"]]
exists = any(exists)
@@ -28,4 +28,5 @@ def addyaml(c, directory):
print(data)
if not exists:
data["members"].append({"directory":directory})
yaml.safe_dump(data, stream)
with open(f, "w") as stream2:
yaml.safe_dump(data, stream2)