fix: Configurable target path for package install/update#205
Open
theVAX wants to merge 1 commit intoviur-framework:mainfrom
Open
fix: Configurable target path for package install/update#205theVAX wants to merge 1 commit intoviur-framework:mainfrom
theVAX wants to merge 1 commit intoviur-framework:mainfrom
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
perform_operation()now reads an optional"target"field from the builds config inproject.json, falling back to the component name. This allows projects to control where packages are installed (e.g. installingviintodeploy/admin/instead ofdeploy/vi/).vi():element == 5was a typo — should beelement == 4. The temp zip filevi.zipwas never deleted after installation.Problem
When running
viur package update vi, the target directory was hardcoded to the component name:Projects that expect the admin UI at
deploy/admin/had no way to override this.Solution
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 admininstalls todeploy/admin/(unchanged)viur package install admininstalls todeploy/admin/(unchanged)viur package update viwith"target": "admin"in config installs todeploy/admin/"target"field: behavior unchanged (backward compatible)