fix(uninstall): remove CLI link/autostart entries, add --purge flag#3
Open
gskril wants to merge 3 commits into
Open
fix(uninstall): remove CLI link/autostart entries, add --purge flag#3gskril wants to merge 3 commits into
gskril wants to merge 3 commits into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.