Skip to content

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

Merged
pi0 merged 5 commits intounjs:mainfrom
RihanArfan:feat/windows-temp-dir
Feb 25, 2025
Merged

fix!: use correct temp dir in windows for cache#182
pi0 merged 5 commits intounjs:mainfrom
RihanArfan:feat/windows-temp-dir

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
@pi0 pi0 changed the title feat: use correct windows temp directory fix!: use correct temp dir in windows for cache Feb 25, 2025
@codecov
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