You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
echo" -p: Path to install contributoor (default: $HOME/.contributoor)"
94
94
echo" -v: Version of contributoor to install without 'v' prefix (default: latest, example: 0.0.6)"
95
95
echo" -u: Uninstall Contributoor"
96
+
echo" -c: Path to config.yaml (only used with -u for uninstall)"
96
97
exit 1
97
98
}
98
99
@@ -599,11 +600,37 @@ EOF
599
600
}
600
601
601
602
uninstall() {
603
+
# Try to determine the installation directory
604
+
local install_dir=""
605
+
606
+
# If config path was provided via -c, use it
607
+
if [ -n"${CONFIG_PATH:-}" ];then
608
+
# Expand ~ to $HOME in a portable way
609
+
CONFIG_PATH=$(echo "$CONFIG_PATH"| sed "s|^~|$HOME|")
610
+
if [ !-f"$CONFIG_PATH" ];then
611
+
fail "Config file not found at: $CONFIG_PATH"
612
+
fi
613
+
install_dir=$(dirname "$CONFIG_PATH")
614
+
else
615
+
# Try using contributoor status
616
+
ifcommand -v contributoor >/dev/null 2>&1;then
617
+
local config_path=$(contributoor status 2>/dev/null | grep "Config Path"| cut -d':' -f2 | tr -d '')
618
+
if [ -n"$config_path" ];then
619
+
install_dir=$(dirname "$config_path")
620
+
fi
621
+
fi
622
+
623
+
# If we couldn't determine the install directory, ask user to specify.
624
+
if [ -z"$install_dir" ];then
625
+
fail "Could not determine installation directory.\nIt's likely you installed contributoor under a custom directory.\n\nPlease specify the directory when running the uninstaller:\n./install.sh -u -c /path/to/custom/config.yaml"
626
+
fi
627
+
fi
628
+
602
629
printf"\n${COLOR_RED}Warning, this will:${COLOR_RESET}\n"
603
630
printf" • Stop and remove any contributoor services (systemd/launchd)\n"
604
631
printf" • Stop and remove any contributoor Docker containers and images\n"
605
632
printf" • Remove contributoor from your PATH\n"
606
-
printf" • Delete all contributoor data from ${HOME}/.contributoor\n\n"
633
+
printf" • Delete all contributoor data from ${install_dir}\n\n"
607
634
printf"Are you sure you want to uninstall? [y/N]: "
0 commit comments