✨ Add --strict-version flag to mod sync#84
Merged
Conversation
Install exact MOD versions from the save file instead of the latest. Deletes newer installed versions since Factorio picks the newest zip when multiple versions coexist.
The portal API response body contains "Mod not found" without the MOD name. By prioritizing api_message, the MOD name was lost from the error shown to users.
When replacing an existing MOD (e.g. with --strict-version), display the transition as "mod-name (old → new)" instead of "mod-name@new".
…rded plan_existing_mod_changes compared nil (from mod-list.json) against the save version, always producing an :update action even when the correct version was already installed. When mod-list.json has no version recorded for a MOD, fall back to the actually installed version for the comparison. This avoids treating already-correct installations as needing an update.
f8656c9 to
e29de92
Compare
RequiresGameStopped is prepended after CommandWrapper, so it sits outer in the call chain. When the game is running, the exception is raised before super is called, meaning CommandWrapper's rescue block is never entered and no error message is displayed. Display the error via say before raising so the user sees it regardless of the call chain order.
When --strict-version removes a newer zip and downloads the save version, the same MOD appeared in Delete, Install, and Update — three redundant lines. Detect mods present in both mods_to_delete and install_targets, show them once under Downgrade, and omit them from the individual sections.
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
Add
--strict-versionflag tomod syncthat installs the exact MOD versions recorded in the save file, rather than the latest available versions.Changes
--strict-versionoption tomod sync--strict-version: installs missing MODs at latest version, does not record version in mod-list.json--strict-version: installs exact save versions, records version in mod-list.json, deletes newer installed versionsBackground
Factorio picks the newest available zip when multiple versions coexist in the MOD directory. So when
--strict-versiondowngrades a MOD, the newer zip must be deleted. The deletion is shown in the pre-sync confirmation plan before any destructive operations.Closes #75