From 15be2b997c62220b276360810eec00873cc25d09 Mon Sep 17 00:00:00 2001 From: Svjatoslav Agejenko Date: Tue, 4 Jun 2024 22:50:21 +0300 Subject: [PATCH] Optionally also delete user config during uninstall --- tools/implement idea | 19 +++---------------- uninstall | 4 ++++ 2 files changed, 7 insertions(+), 16 deletions(-) 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 -- 2.20.1