Commit 3b5616b1 authored by Mickaël Desfrênes's avatar Mickaël Desfrênes
Browse files

add post-install script execution

parent a26189c2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
__version__ = "0.2.8"
__version__ = "0.2.9"
+19 −1
Original line number Diff line number Diff line
@@ -262,6 +262,7 @@ app = typer.Typer(help=_(CLI_MAIN_HELP))

def _sync_bundles(root_directory: Path):
    ignore_file = ".ignore"
    installed_file = ".installed"
    dot_max_dir = Path(root_directory, ".max")
    official_bundles_dir = Path(dot_max_dir, "basex", "webapp", "max", "bundles")
    # first deactivate everything
@@ -301,6 +302,23 @@ def _sync_bundles(root_directory: Path):
            # deactivate vocabulary bundles if they're not the vocabulary used in the projects
            print(_("Ce bundle de vocabulaire sera ignoré: "), bundle_name)
            Path(bundle_dir, ignore_file).touch()
        if (
            Path(bundle_dir, "install.xq").exists()
            and not Path(bundle_dir, installed_file).exists()
        ):
            process_args = [
                str(ensure_java()),
                "-cp",
                cp_paths(root_directory),
                "-Xmx2g",
                "org.basex.BaseX",
                "-u",
                "-b",
                f'maxPath="{root_directory}"',
                str(Path(bundle_dir, "install.xq")),
            ]
            subprocess.run(process_args)
            Path(bundle_dir, installed_file).touch()
    _ping_projects(root_directory)


@@ -775,7 +793,7 @@ def bundles_add(
            config.vocabulary_bundle = bundle_name
        config.write()
        _sync_max_instance(directory, verbose=False)
        bundles_list(directory)
        bundles_list(str(directory))
    else:
        if bundle_name not in config.available_bundles.keys():
            rich_print(