From 08e95c08ca0908abe6b0ba0fdcd364e908dc0bca Mon Sep 17 00:00:00 2001 From: kaiyou Date: Sun, 22 Apr 2018 11:53:40 +0200 Subject: [PATCH] Add a way to get a dev environment --- config/setup.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/config/setup.py b/config/setup.py index 4cff7a43..6aeca5d3 100644 --- a/config/setup.py +++ b/config/setup.py @@ -9,7 +9,7 @@ import re VERSION_BRANCH = re.compile("(master|\d+\.\d+)") -def main(upstream, dest): +def main(upstream, dest, dev=True): shutil.rmtree(dest, ignore_errors=True) os.makedirs(dest, exist_ok=True) with tempfile.TemporaryDirectory() as clone_path: @@ -25,10 +25,14 @@ def main(upstream, dest): if os.path.exists(config_path): shutil.copytree(config_path, os.path.join(dest, name)) print("Imported branch {}".format(name)) + if dev: + shutil.copytree(".", os.path.join(dest, "dev")) + print("Imported dev") if __name__ == "__main__": parser = argparse.ArgumentParser() + parser.add_argument("--dev", action="store_true", help="Copy the local dir in /dev") parser.add_argument("upstream", help="Path to Mailu git repository") parser.add_argument("dest", help="Destination directory for data files") args = parser.parse_args()