Add replace-version command#54
Merged
Merged
Conversation
Adds a standalone `pup replace-version <version>` command that writes a given version number into all files configured under .puprc paths.versions. Previously this only happened implicitly during a dev build/package; this exposes it as its own command for release/zip prep. Supports --dev and --root, and includes docs plus CLI tests. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Guard preg_replace against null return (invalid regex) to avoid silently truncating version files, and skip files where the regex matches nothing instead of reporting a false "Updated". - Extract duplicated getDevSuffix() into a shared DevSuffix trait, used by both replace-version and get-version. - Add a --dev test; drop the snapshot assertion (no committed snapshot; explicit assertions already cover behavior). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
d4mation
reviewed
Jun 5, 2026
d4mation
approved these changes
Jun 5, 2026
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.
Resolves: SOENG-39
What this adds
A new
pup replace-version <version>command that updates the version number in every file you've configured under.puprcpaths.versions.Until now, version replacement only happened implicitly as part of a dev build / package. This pulls that behavior into a standalone command so you can bump versions on demand — handy when prepping a release or staging a zip without running a full package.
Usage
Also supports
--rootto run against a different directory, matchingget-versionandpackage.Notes
package) — that's intentional for release prep.DEMO
Screen.Recording.2026-06-05.at.10.32.48.AM.mov