Commit 5b3e985c authored by Mickaël Desfrênes's avatar Mickaël Desfrênes
Browse files

rm empty dir when command new is interrupted

parent 23c96b0d
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -356,6 +356,7 @@ def _sync_max_instance(root_directory: Path, verbose=True):
            + "[/bold]"
        )
    config = MaXProjectConfig(Path(root_directory, "config.xml"))
    config.max_version_from_max_dir
    dot_max_dir = Path(root_directory, ".max")
    if not os.path.isdir(dot_max_dir):
        dot_max_dir.mkdir(parents=True, exist_ok=True)
@@ -443,6 +444,7 @@ def new(
            init_values["env"] = _choose_between(["dev", "prod"], _("Environnement"))
            init_values["title"] = typer.prompt(_("Titre du projet"))
        except (KeyboardInterrupt, TypeError):
            root_directory.rmdir()
            return
    _install_new_max_instance(root_directory, init_values)