Skip to content

Commit

Permalink
allow multiple files
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewprzh committed Aug 1, 2024
1 parent 4b4810a commit 7e44fc4
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions tests/github/update_defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def parse_args():
parser = argparse.ArgumentParser(formatter_class=argparse.RawDescriptionHelpFormatter)
parser.add_argument("--branch", type=str, help="branch to use [master]", default="master")
parser.add_argument("--output", type=str, help="custom output folder (do not set if default)")
parser.add_argument("config_file", metavar="config_file", type=str, help="configuration .info file")
parser.add_argument("config_file", metavar="config_file", type=str, nargs="+", help="configuration .info file")

args = parser.parse_args()
return args
Expand All @@ -58,22 +58,22 @@ def main():
print("Provide configuration file")
exit(-2)

config_file = args.config_file
if not os.path.exists(config_file):
print("Provide correct path to configuration file, %s does not exits" % config_file)
exit(-3)

print("Loading config from %s" % config_file)
config_dict = load_tsv_config(config_file)
run_name = config_dict["name"]
output_folder = os.path.join(os.path.join(args.output if args.output else config_dict["output"], args.branch), run_name)
for et in etalon_dict.keys():
if et not in config_dict:
continue
new_etalon = os.path.join(output_folder, etalon_dict[et])
old_etalon = fix_path(config_file, config_dict[et])
print("Updating %s from %s" % (new_etalon, old_etalon))
shutil.copy2(new_etalon, old_etalon)
for config_file in args.config_file:
if not os.path.exists(config_file):
print("Provide correct path to configuration file, %s does not exits" % config_file)
exit(-3)

print("Loading config from %s" % config_file)
config_dict = load_tsv_config(config_file)
run_name = config_dict["name"]
output_folder = os.path.join(os.path.join(args.output if args.output else config_dict["output"], args.branch), run_name)
for et in etalon_dict.keys():
if et not in config_dict:
continue
new_etalon = os.path.join(output_folder, etalon_dict[et])
old_etalon = fix_path(config_file, config_dict[et])
print("Updating %s from %s" % (new_etalon, old_etalon))
shutil.copy2(new_etalon, old_etalon)


if __name__ == "__main__":
Expand Down

0 comments on commit 7e44fc4

Please sign in to comment.