Skip to content

fix: Configurable target path for package install/update#205

Open
theVAX wants to merge 1 commit intoviur-framework:mainfrom
theVAX:fix/package-target-path
Open

fix: Configurable target path for package install/update#205
theVAX wants to merge 1 commit intoviur-framework:mainfrom
theVAX:fix/package-target-path

Conversation

@theVAX
Copy link
Member

@theVAX theVAX commented Feb 23, 2026

Summary

  • Configurable target path: perform_operation() now reads an optional "target" field from the builds config in project.json, falling back to the component name. This allows projects to control where packages are installed (e.g. installing vi into deploy/admin/ instead of deploy/vi/).
  • Fix temp file cleanup in vi(): element == 5 was a typo — should be element == 4. The temp zip file vi.zip was never deleted after installation.

Problem

When running viur package update vi, the target directory was hardcoded to the component name:

operations_links[component](version, target=component, ...)
#                                    target="vi" → deploy/vi/

Projects that expect the admin UI at deploy/admin/ had no way to override this.

Solution

target = conf.get("builds", {}).get(component, {}).get("target", component)

Projects can now optionally set a "target" field in their builds config:

{
    "builds": {
        "vi": {
            "command": "viur package install vi",
            "kind": "exec",
            "version": "3.0.37",
            "target": "admin"
        }
    }
}

Without "target", behavior is unchanged (falls back to component name).

Test plan

  • viur package update admin installs to deploy/admin/ (unchanged)
  • viur package install admin installs to deploy/admin/ (unchanged)
  • viur package update vi with "target": "admin" in config installs to deploy/admin/
  • Without "target" field: behavior unchanged (backward compatible)

The target directory was hardcoded to the component name (e.g. "vi"
installs to deploy/vi/). This reads an optional "target" field from the
builds config in project.json, falling back to the component name.

Also fixes a typo in vi() where element == 5 should be element == 4,
causing the temp zip file to never be cleaned up.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant