build: only write new minAppVersion requirements to versions.json
#142
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.
Currently, the
version-bump.mjs
script will write a newversion
:minAppVersion
pair on every run with a version which is not yet inversions.json
. However, we only need to updateversions.json
if the minAppVersion for the plugin changes. This PR modifies the script such that it only adds a new version requirement ifminAppVersion
in the currentmanifest.json
is not already inversions.json
. This should declutterversions.json
.Important:
This simply checks whether the
minAppVersion
is part of theversions.json
or not. But it does not do any semantic comparisons of the existing versions against the newminAppVersion
. This might lead to the (I guess unlikely, but entirely possible) situation that a lowerminAppVersion
for a newer plugin version is added toversions.json
. I can't foresee if Obsidian would handle this gracefully, if that would be expected behaviour anyway, or if it would break things. However, since the current version ofversion-bump.mjs
simply adds whateverminAppVersion
the updatedmanifest.json
contains, we won't be changing that fundamental behaviour.