mirror of
https://github.com/Mailu/Mailu.git
synced 2025-01-14 02:34:22 +02:00
Add a way to get a dev environment
This commit is contained in:
parent
5a9f01d473
commit
08e95c08ca
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user