Repository navigation
fix(env): report Updated when vp env pin overwrites an existing file - #3377
Draft
CheHyeonYeong wants to merge 1 commit into
Draft
CheHyeonYeong wants to merge 1 commit into
CheHyeonYeong wants to merge 1 commit into
Conversation
`vp env pin` always printed "Created .node-version" even when it overwrote an existing file, and "Updated .nvmrc" even when it created a new one. Report Created or Updated based on whether the file existed. Closes voidzero-dev#3370
This branch has not been deployed
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.
Closes #3370
vp env pinalways printedCreated .node-versioneven when it overwrote an existing file (with or without--force). The.nvmrcpath had the opposite problem:--target nvmrcprintedUpdated .nvmrcwhen it created a new file.Both paths now print
CreatedorUpdateddepending on whether the file existed before the write.Changes
pin.rs: track whether the target file existed and print the message through a sharedprint_pin_file_writtenhelpernode_version_keeps_priority_over_nvmrc:Created→Updated(overwrites an existing.node-version)explicit_nvmrc_target_can_create_a_pin:Updated→Created(creates a new.nvmrc)node_version_pin_reports_created_then_updatedcase covering create → overwriterfcs/env-command.md: overwrite examples now show theUpdated .node-versionlineTesting
VP_SNAP_SKIP_FLAVORS=local cargo test -p vp_cli_snapshots -- command_env_pin(25 passed)cargo test -p vp_global_cli pin,cargo clippy -p vp_global_cli,cargo fmt --check