about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorSoispha <soispha@vhack.eu>2024-01-01 23:39:05 +0100
committerSoispha <soispha@vhack.eu>2024-01-01 23:39:05 +0100
commit4284b3525086a55bbe96f8e9af266e5b8a3711c3 (patch)
tree126a110217319ea4e885ea61a2ca5764d2c8f443
parentfix(hm/pkgs/scr/ytc): Allow titles with commas in them (diff)
downloadnixos-config-4284b3525086a55bbe96f8e9af266e5b8a3711c3.tar.gz
nixos-config-4284b3525086a55bbe96f8e9af266e5b8a3711c3.zip
fix(hm/pkgs/scr/yts): Always stop the active task, when exiting
-rwxr-xr-xhm/soispha/pkgs/scripts/wrappers/yts6
1 files changed, 5 insertions, 1 deletions
diff --git a/hm/soispha/pkgs/scripts/wrappers/yts b/hm/soispha/pkgs/scripts/wrappers/yts
index 3ff8e37a..b5edf52c 100755
--- a/hm/soispha/pkgs/scripts/wrappers/yts
+++ b/hm/soispha/pkgs/scripts/wrappers/yts
@@ -5,6 +5,11 @@ SHELL_LIBRARY_VERSION="1.10.2" . %SHELL_LIBRARY_PATH
 
 TASK_UUID=ce4f9e07-8324-4570-8be6-967955e9271e
 
+cleanup() {
+    task stop "$TASK_UUID"
+}
+trap cleanup EXIT
+
 help_text="
 #
 # Commands:
@@ -57,5 +62,4 @@ done < "$selection_file"
 
 [ "$ids" != "" ] && ytc "$ids";
 
-task stop "$TASK_UUID"
 # vim: ft=sh