feat: add uninstall script#1404
Conversation
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
| fi | ||
|
|
||
| if grep -q '[^[:space:]]' "$tmp"; then | ||
| mv "$tmp" "$rc_file" |
There was a problem hiding this comment.
🟡 mv from mktemp file silently changes shell config file permissions to 0600
cleanup_shell_config creates a temp file via mktemp (which uses mode 0600), runs awk to filter the contents, then does mv "$tmp" "$rc_file" on line 91. The mv replaces the original file's inode with the temp file's, so the shell config (e.g. ~/.bashrc, ~/.zshrc) inherits the 0600 permissions of the temp file instead of keeping its original permissions (typically 0644). This silently restricts the file's permissions. The fix is to write back to the original file preserving its inode and permissions, e.g. cat "$tmp" > "$rc_file" && rm -f "$tmp", or to capture and restore the original permissions before moving.
| mv "$tmp" "$rc_file" | |
| cat "$tmp" > "$rc_file" && rm -f "$tmp" |
Was this helpful? React with 👍 or 👎 to provide feedback.
| @@ -0,0 +1,179 @@ | |||
| #!/usr/bin/env bash | |||
There was a problem hiding this comment.
🟡 uninstall.sh committed without executable permission, inconsistent with install.sh
The file is committed with mode 100644 (not executable), while install.sh is 100755. Since uninstall.sh has a #!/usr/bin/env bash shebang and is intended to be run directly (similar to install.sh), it should be executable. Users who download and try to run ./uninstall.sh will get a "Permission denied" error.
Prompt for agents
The file uninstall.sh is committed with mode 100644 (not executable), but install.sh uses 100755. Run `git update-index --chmod=+x uninstall.sh` or `chmod +x uninstall.sh && git add uninstall.sh` to set the executable bit in git, matching the convention used by install.sh.
Was this helpful? React with 👍 or 👎 to provide feedback.
This PR adds an
uninstall.shscript that allows users to easily uninstallgit-aiwhether they need to for debugging reasons or they simply no longer wish to use the product.