about summary refs log tree commit diff stats
path: root/hm/soispha/pkgs/scripts/specific/ytcc
diff options
context:
space:
mode:
authorSoispha <soispha@vhack.eu>2024-01-06 21:34:46 +0100
committerSoispha <soispha@vhack.eu>2024-01-06 21:34:46 +0100
commit40179fbcfaba8f0767d1443b75417081dabe0ff2 (patch)
tree3aa4fdc6de97cd66774272a153790486796b820a /hm/soispha/pkgs/scripts/specific/ytcc
parentfix(hm/pkgs/scr/specific/ytcc/yts): Add default ordering mode (diff)
downloadnixos-config-40179fbcfaba8f0767d1443b75417081dabe0ff2.zip
fix(hm/pkgs/scr/specific/ytcc/yts): Only trap the task stop if it's started
Diffstat (limited to 'hm/soispha/pkgs/scripts/specific/ytcc')
-rwxr-xr-xhm/soispha/pkgs/scripts/specific/ytcc/yts9
1 files changed, 4 insertions, 5 deletions
diff --git a/hm/soispha/pkgs/scripts/specific/ytcc/yts b/hm/soispha/pkgs/scripts/specific/ytcc/yts
index 390cc0f5..534151a6 100755
--- a/hm/soispha/pkgs/scripts/specific/ytcc/yts
+++ b/hm/soispha/pkgs/scripts/specific/ytcc/yts
@@ -9,11 +9,6 @@ AUTHORS="Soispha"
 YEARS="2023"
 NAME="neorg"
 
-cleanup() {
-    task stop "$TASK_UUID"
-}
-trap cleanup EXIT
-
 help_text="
 # Commands:
 # w, watch <id> = watch id
@@ -94,6 +89,10 @@ table="$(ytcc --output json list "$@" | jq --raw-output 'map("pick \(.id) \(.tit
 
 selection_file="$(mktmp)";
 
+cleanup() {
+    task stop "$TASK_UUID"
+}
+trap cleanup EXIT
 task start "$TASK_UUID"
 
 echo "$table" > "$selection_file";