Skip to content

fix: refuse drive-root children and foreign InstallRoot contents - #28

Merged
coreybutler merged 1 commit into
mainfrom
fix/install-root-drive-child
Nov 2, 2026
Merged

coreybutler merged 1 commit into
mainfrom
fix/install-root-drive-child

Conversation

@coreybutler

Copy link
Copy Markdown
Contributor

What

Refuse Node InstallRoot when its parent is a drive root (D:\tools), and when the folder already contains non-NVM content. Tighten IsSafeToDeleteInstallRoot so uninstall will not DelTree shared folders.

Why

A user set storage to a shallow path under D:\. DataRoot became the drive / shared tools folder; uninstall wiped sibling apps. We only warned on risky layout before; drive roots themselves were blocked, but D:\soft was allowed.

Testing

  • go test ./fs (common)
  • New cases: C:\nvm / D:\soft denied; nested C:\nvm-tools\installs allowed; foreign vs version-only contents

Risk

Medium — users who intentionally used D:\nvm as InstallRoot must move to D:\nvm\installs (or similar nesting). That layout was already unsafe (runtime on the drive root).

Hard-deny InstallRoot when DataRoot would be a drive root (D:\tools), and when the folder already holds non-NVM apps. Uninstall may DelTree only dedicated version trees.

Signed-off-by: Corey Butler <corey@author.io>
@coreybutler
coreybutler merged commit 85a861a into main Nov 2, 2026
2 checks passed
@coreybutler
coreybutler deleted the fix/install-root-drive-child branch November 2, 2026 05:32
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