for reg in conf["registries"]:
if test_reg_name == reg["name"]:
src_registry = os.path.join(test_reg_path, reg["path"])
reg_path = os.path.join(tmp_dir, *os.path.join(reg["name"], reg["path"]).split("/")[:-1])
if not os.path.exists(reg_path):
os.makedirs(reg_path)
print("cp -r %s %s" % (src_registry, reg_path))
os.system("cp -r %s %s" % (src_registry, reg_path))
else:
reg_path = os.path.join(tmp_dir, reg["name"])
After Change
for reg in conf["registries"]:
if test_reg_name == reg["name"]:
excludes = [".git*", ".idea", "vendor", "node_modules"]
sync_cmd = "rsync -a %s %s %s" % (test_reg_path, os_tmp_dir, " ".join(["--exclude=" + term for term in excludes]))
print(sync_cmd)
os.system(sync_cmd)
else: