fixed bug in build-pacman-repo
This commit is contained in:
5
tasks.py
5
tasks.py
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user