Skip to content

fix: honor --force on update to bypass local cache - #5

Open
DinonowDev wants to merge 2 commits into
amirkabiri:mainfrom
DinonowDev:fix/update-force
Open

fix: honor --force on update to bypass local cache#5
DinonowDev wants to merge 2 commits into
amirkabiri:mainfrom
DinonowDev:fix/update-force

Conversation

@DinonowDev

Copy link
Copy Markdown

Summary

  • Skip re-fetching when available.json is fresher than one hour unless --force is passed.
  • With --force, bypass local TTL and bust HTTP cache when refreshing the version list.

Test plan

  • Run chvm update twice quickly and confirm the second run uses the cache message
  • Run chvm update --force and confirm the list is refreshed
  • Confirm a successful force update rewrites ~/.chvm/available.json

The update command fired fetch without awaiting it, so the process
could exit before available.json was written.
Skip re-fetch when available.json is fresher than one hour, unless
--force is passed (also busts HTTP cache).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant