WIP: dev into master #184

Draft
edraft wants to merge 121 commits from dev into master
Showing only changes of commit 91269f351b - Show all commits

View File

@@ -116,7 +116,7 @@ class Structure:
return workspace return workspace
@staticmethod @staticmethod
def init_project(rel_path: str, name: str, project_type: str, workspace: Workspace | None, install_deps=False, verbose=False): def init_project(rel_path: str, name: str, project_type: str, workspace: Workspace | None, verbose=False):
if not Path(rel_path).exists(): if not Path(rel_path).exists():
rel_path = click.prompt("Project directory", type=click.Path(exists=True, file_okay=False), default="src") rel_path = click.prompt("Project directory", type=click.Path(exists=True, file_okay=False), default="src")
@@ -139,7 +139,6 @@ class Structure:
project.save() project.save()
if install_deps:
from cpl.cli.command.package.install import install from cpl.cli.command.package.install import install
old_cwd = os.getcwd() old_cwd = os.getcwd()
@@ -152,7 +151,7 @@ class Structure:
os.chdir(old_cwd) os.chdir(old_cwd)
if workspace is not None: if workspace is not None:
rel_path = str(path.resolve().absolute().relative_to(Path(workspace.path).parent)) rel_path = str(path.resolve().absolute().relative_to(Path(workspace.path).parent)).replace("\\", "/")
if rel_path not in workspace.projects: if rel_path not in workspace.projects:
workspace.projects.append(rel_path) workspace.projects.append(rel_path)
workspace.save() workspace.save()
@@ -200,4 +199,4 @@ class Structure:
shutil.copy(src_file, tgt_file) shutil.copy(src_file, tgt_file)
Console.write_line() Console.write_line()
Structure.init_project(str(path), name, project_type, workspace, install_deps=True, verbose=verbose) Structure.init_project(str(path), name, project_type, workspace, verbose=verbose)