From 40179fbcfaba8f0767d1443b75417081dabe0ff2 Mon Sep 17 00:00:00 2001 From: Soispha Date: Sat, 6 Jan 2024 21:34:46 +0100 Subject: fix(hm/pkgs/scr/specific/ytcc/yts): Only trap the task stop if it's started --- hm/soispha/pkgs/scripts/specific/ytcc/yts | 9 ++++----- 1 file 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 = 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"; -- cgit 1.4.1