From: Svjatoslav Agejenko Date: Tue, 4 Jun 2024 19:50:21 +0000 (+0300) Subject: Optionally also delete user config during uninstall X-Git-Url: http://www2.svjatoslav.eu/gitweb/?a=commitdiff_plain;h=15be2b997c62220b276360810eec00873cc25d09;p=alyverkko-cli.git Optionally also delete user config during uninstall --- diff --git a/tools/implement idea b/tools/implement idea index be59c5e..6472735 100755 --- a/tools/implement idea +++ b/tools/implement idea @@ -2,24 +2,11 @@ cd "${0%/*}"; if [ "$1" != "T" ]; then gnome-terminal -e "'$0' T"; exit; fi; cd .. -# This script will prompt the user for a topic name if it is not -# provided as an argument. Alternatively, you can run the script with -# the desired topic name as the first argument: - -# implement_idea - - -# Function to ask for the topic name if not provided -ask_for_topic() { - read -p "Enter the topic name: " topic - echo "$topic" -} - - -# Use a default topic name or ask the user for one -TOPIC_NAME="${1:-$(ask_for_topic)}" +read -p "Enter the topic name: " TOPIC_NAME alyverkko-cli joinfiles -t "$TOPIC_NAME" --src-dir . --pattern "*.org" alyverkko-cli joinfiles -t "$TOPIC_NAME" --src-dir . --pattern "*.java" alyverkko-cli joinfiles -t "$TOPIC_NAME" --src-dir . --pattern "implement*" +alyverkko-cli joinfiles -t "$TOPIC_NAME" --src-dir . --pattern "install" +alyverkko-cli joinfiles -t "$TOPIC_NAME" --src-dir . --pattern "uninstall" alyverkko-cli joinfiles -t "$TOPIC_NAME" --edit diff --git a/uninstall b/uninstall index 7e4138e..b4a4474 100755 --- a/uninstall +++ b/uninstall @@ -7,3 +7,7 @@ sudo systemctl disable alyverkko-cli sudo rm "$SYSTEMD_SERVICE_FILE" sudo rm -rf /opt/alyverkko-cli/ +read -p "Do you want to remove user configuration as well? (y/N) " remove_config +if [[ $remove_config == [Yy] ]]; then + sudo rm -rf "${HOME}/.config/alyverkko-cli" +fi