Skip to content

Commit

Permalink
chore: Script to merge hash txt files (#1728)
Browse files Browse the repository at this point in the history
Small helper script to merge hash text files
  • Loading branch information
paulgessinger committed Dec 12, 2022
1 parent 5cab50d commit 701f4f7
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions CI/merge_hashes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env python3
import argparse

p = argparse.ArgumentParser()
p.add_argument("output")
p.add_argument("files", nargs="+")

args = p.parse_args()

items = {}

for file in args.files:
with open(file) as fh:
for line in fh:
key, value = line.split(":", 1)
items[key.strip()] = value.strip()

with open(args.output, "w") as fh:
for key, value in items.items():
fh.write(f"{key}: {value}\n")

0 comments on commit 701f4f7

Please sign in to comment.