From 782be942eb29a67f5abc590d00956f489d229836 Mon Sep 17 00:00:00 2001 From: Adrian Wannenmacher Date: Fri, 18 Jun 2021 20:02:03 +0200 Subject: [PATCH] feat: :sparkles: stop deleting or overwriting config file --- install.fish | 9 +++++++-- uninstall.fish | 3 --- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/install.fish b/install.fish index 6ae07c2..1a08a41 100755 --- a/install.fish +++ b/install.fish @@ -8,8 +8,13 @@ if not test -d "/etc/snap-pac-uki" echo "created config dir." end -cp ./src/config.fish /etc/snap-pac-uki/config.fish -echo "installed config script." +if not test -f "/etc/snap-pac-uki/config.fish" + cp ./src/config.fish /etc/snap-pac-uki/config.fish + echo "installed config script." +else + cp ./src/config.fish /etc/snap-pac-uki/config-new.fish + echo "found existing config script -> installed as -new file." +end cp ./pacman/* /usr/share/libalpm/hooks/ echo "installed pacman hooks." diff --git a/uninstall.fish b/uninstall.fish index 14ed5a7..9c9e427 100755 --- a/uninstall.fish +++ b/uninstall.fish @@ -3,9 +3,6 @@ rm /usr/local/bin/snap-pac-uki echo "removed script." -rm /etc/snap-pac-uki/config.fish -echo "removed config script." - for name in (ls ./pacman) rm /usr/share/libalpm/hooks/$name end