Default install stanza multi-game support, catch missing install_to #3441
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.
Problem
In KSP-CKAN/NetKAN#8735, this metadata:
caused this error:
Cause
install_to
is required by the spec, andNetKAN.Validators.InstallValidator
assumesinstall_to
will be set. In this instance, it wasn't, because that YAML translates to:We should catch this explicitly rather than throwing a NRE.
Motivation
That PR's changes were essentially trying to make the default install stanza's behavior more explicit, so they've been set aside. However, in the process of explaining this I realized that the default install stanza is KSP1-specific: it hard-codes
GameData
. This would make default stanzas unusable for any future supported game that uses a different folder for mod data.Changes
install_to
isn't set, we throw an explicit error saying thatPrimaryModDirectoryRelative
property of the module's game, which will beGameData
for KSP1 and wherever mods are supposed to go instead for other games