#!/bin/sh # Uninstall ctask from ~/.local/bin (or pass an alternative directory as $1). # Removes the binary and ctask-statusline.sh helper from the install directory. # Does NOT remove CTASK_ROOT, workspaces, or task data. set -eu INSTALL_DIR="${1:-$HOME/.local/bin}" printf 'ctask uninstall\n' printf ' Install dir: %s\n\n' "$INSTALL_DIR" if [ ! -d "$INSTALL_DIR" ]; then printf ' Nothing to uninstall. Directory does not exist.\n' exit 0 fi # Only remove ctask-owned files removed=0 for name in ctask ctask-statusline.sh; do target="$INSTALL_DIR/$name" if [ -f "$target" ]; then rm -f "$target" printf ' Removed %s\n' "$name" removed=$((removed + 1)) fi done if [ "$removed" = "0" ]; then printf ' No ctask files found in install directory.\n' fi printf '\n PATH: not modified.\n' printf ' If you added %s to $PATH manually, remove the entry from your shell config.\n' "$INSTALL_DIR" printf '\nWorkspace data is untouched:\n' root="${CTASK_ROOT:-$HOME/ai-workspaces}" printf ' %s\n' "$root" printf '\nDone.\n'