Skip to content

fix(uninstall): remove CLI link/autostart entries, add --purge flag#3

Open
gskril wants to merge 3 commits into
stigmergic-org:masterfrom
gskril:fix/uninstall-cleanup
Open

fix(uninstall): remove CLI link/autostart entries, add --purge flag#3
gskril wants to merge 3 commits into
stigmergic-org:masterfrom
gskril:fix/uninstall-cleanup

Conversation

@gskril

@gskril gskril commented Apr 29, 2026

Copy link
Copy Markdown

Not tested - feel free to discard this code but high level it'd be nice to have an easy way to do a clean uninstall


system uninstall now removes /usr/local/bin/neomist (macOS) and the autostart entry (LaunchAgent plist / .desktop file) that system install creates. Previously these were left behind with no way to remove them.

Added --purge flag that additionally removes all user data: the IPFS repo/binary (~/.local/share/neomist/), config (~/.config/neomist/), and cache (~/.cache/neomist/). This mirrors the apt remove vs apt purge distinction and is appropriate when fully uninstalling the app. The --purge flag is forwarded correctly through the pkexec elevation path on Linux.

Greg Skriloff and others added 3 commits April 29, 2026 02:38
system uninstall now removes /usr/local/bin/neomist (macOS) and the
autostart entry (LaunchAgent plist / .desktop file) that system install
creates. Previously these were left behind with no way to remove them.

Added --purge flag that additionally removes all user data: the IPFS
repo/binary (~/.local/share/neomist/), config (~/.config/neomist/),
and cache (~/.cache/neomist/). This mirrors the apt remove vs apt purge
distinction and is appropriate when fully uninstalling the app. The
--purge flag is forwarded correctly through the pkexec elevation path
on Linux.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Two bugs in the --purge implementation:

1. config_dir() and cache_dir() both call fs::create_dir_all internally,
   so using them in the purge block would create a directory then
   immediately delete it. Added config_dir_path() and cache_dir_path()
   variants that return the path without side effects, and use those
   in the purge block instead.

2. On Linux, system uninstall is re-invoked via pkexec which resets HOME
   to root's home. Config and cache paths derived from BaseDirs::new()
   would resolve to /root/.config/neomist and /root/.cache/neomist,
   silently missing the real user's directories. Fix: pre-resolve both
   paths in the non-elevated context (where HOME is correct) and pass
   them as NEOMIST_CONFIG_DIR and NEOMIST_CACHE_DIR env vars, mirroring
   the existing NEOMIST_DATA_DIR pattern. config_dir_path() and
   cache_dir_path() check these env vars first.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

2 participants