From fbb2d9000f2b17c3a993f3a83f3ab2c1ceaada47 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Sun, 21 Jun 2026 02:07:08 -0700 Subject: [PATCH] fix(uninstall.ps1): drop the empty ~/.unsloth left behind on WoA uninstall The empty-dir sweep of ~/.unsloth ran before the WoA-fallback block removes ~/.unsloth\unsloth.ico, so on a Windows-on-ARM install the still-present icon kept the dir non-empty at sweep time and it was skipped -- leaving an empty ~/.unsloth behind after a full uninstall. Re-attempt the empty-only removal right after the icon is deleted (the last default-mode child). uninstall.sh is unaffected: its rmdir runs as the final step. --- scripts/uninstall.ps1 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/uninstall.ps1 b/scripts/uninstall.ps1 index 7ff9ee3f66..020fb85781 100644 --- a/scripts/uninstall.ps1 +++ b/scripts/uninstall.ps1 @@ -461,6 +461,13 @@ function Uninstall-UnslothStudio { } # The WoA shortcut icon lives under the user profile (icon broker can't read AppData\Local). if ($env:USERPROFILE) { _RemovePath (Join-Path $env:USERPROFILE ".unsloth\unsloth.ico") } + # The empty-dir sweep of ~/.unsloth above ran BEFORE this icon removal, so on a WoA install + # the still-present unsloth.ico kept ~/.unsloth non-empty then and it was skipped -- leaving an + # empty ~/.unsloth behind. Re-attempt now that the icon (the last default-mode child) is gone. + if ($defaultUnslothHome -and (Test-Path -LiteralPath $defaultUnslothHome) -and + -not (Get-ChildItem -LiteralPath $defaultUnslothHome -Force -ErrorAction SilentlyContinue)) { + _RemovePath $defaultUnslothHome + } # Remove the Studio install inside each WSL distro (the real GPU install + any CUDA llama.cpp build). if (Get-Command wsl.exe -ErrorAction SilentlyContinue) { try {