Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix!: use correct temp dir in windows for cache #182

Merged
merged 5 commits into from
Feb 25, 2025

Conversation

RihanArfan
Copy link
Contributor

@RihanArfan RihanArfan commented Aug 2, 2024

Resolves #178

On Windows, the template cache is moved to the user's temp directory (%temp%/giget). This follows the correct OS conventions and allows Windows storage utils (Disk Clean-up, Storage Sense) to delete the cache to free storage if the user desires.

It will move the cache directory if oldDir && !newDir. This logic requires running resolve() to get both the Windows and other OS cache paths at the same time and existsSync() twice on Windows. We remove the migration code after some time in the future, and simplify to 437adc3 (#182)

store template cache within the windows user's temp directory (%temp%)
@RihanArfan RihanArfan changed the title feat: feat: use correct windows temp directory feat: use correct windows temp directory Aug 2, 2024
@RihanArfan RihanArfan marked this pull request as ready for review August 2, 2024 11:19
@RihanArfan RihanArfan force-pushed the feat/windows-temp-dir branch from d12b1b5 to 6900924 Compare August 2, 2024 11:20
@pi0 pi0 changed the title feat: use correct windows temp directory fix!: use correct temp dir in windows for cache Feb 25, 2025
Copy link

codecov bot commented Feb 25, 2025

Codecov Report

Attention: Patch coverage is 35.71429% with 9 lines in your changes missing coverage. Please review.

Project coverage is 45.60%. Comparing base (743c9ae) to head (df2f0e2).
Report is 56 commits behind head on main.

Files with missing lines Patch % Lines
src/_utils.ts 35.71% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #182      +/-   ##
==========================================
- Coverage   54.63%   45.60%   -9.04%     
==========================================
  Files           7        6       -1     
  Lines         615      500     -115     
  Branches       47       48       +1     
==========================================
- Hits          336      228     -108     
+ Misses        278      272       -6     
+ Partials        1        0       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pi0 pi0 merged commit 4849362 into unjs:main Feb 25, 2025
2 checks passed
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.

Move cache directory on Windows to AppData
2 participants