Add a way to get a dev environment
This commit is contained in:
@@ -9,7 +9,7 @@ import re
|
|||||||
VERSION_BRANCH = re.compile("(master|\d+\.\d+)")
|
VERSION_BRANCH = re.compile("(master|\d+\.\d+)")
|
||||||
|
|
||||||
|
|
||||||
def main(upstream, dest):
|
def main(upstream, dest, dev=True):
|
||||||
shutil.rmtree(dest, ignore_errors=True)
|
shutil.rmtree(dest, ignore_errors=True)
|
||||||
os.makedirs(dest, exist_ok=True)
|
os.makedirs(dest, exist_ok=True)
|
||||||
with tempfile.TemporaryDirectory() as clone_path:
|
with tempfile.TemporaryDirectory() as clone_path:
|
||||||
@@ -25,10 +25,14 @@ def main(upstream, dest):
|
|||||||
if os.path.exists(config_path):
|
if os.path.exists(config_path):
|
||||||
shutil.copytree(config_path, os.path.join(dest, name))
|
shutil.copytree(config_path, os.path.join(dest, name))
|
||||||
print("Imported branch {}".format(name))
|
print("Imported branch {}".format(name))
|
||||||
|
if dev:
|
||||||
|
shutil.copytree(".", os.path.join(dest, "dev"))
|
||||||
|
print("Imported dev")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
parser = argparse.ArgumentParser()
|
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("upstream", help="Path to Mailu git repository")
|
||||||
parser.add_argument("dest", help="Destination directory for data files")
|
parser.add_argument("dest", help="Destination directory for data files")
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|||||||
Reference in New Issue
Block a user