extra error handling

This commit is contained in:
Emre AKYÜZ 2023-11-19 15:55:28 +03:00 committed by GitHub
parent 996af9904e
commit 60866cad50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,6 +8,11 @@ CUSTOM_LIST_DIR="$DATA_DIR/custom_lists"
mkdir -p "$DATA_DIR" "$DOWNLOAD_DIR" "$CUSTOM_LIST_DIR"
[ "$(find "$DATA_DIR" -maxdepth 1 -type f -name "*.tsv" 2>/dev/null)" ] || {
notify-send "You need to run "channelrefresh" script first."
exit 1
}
DMENU() {
dmenu -i -l $1 -p "$2"
}
@ -64,7 +69,7 @@ custom_list_menu() {
[ -z "$list" ] && return
case "$list" in
*CREATE*)
new_list=$(DMENU 0 "Enter the name of the new list")
new_list=$(echo "" | DMENU 0 "Enter the name of the new list")
[ -n "$new_list" ] && touch "$CUSTOM_LIST_DIR/$new_list"
;;
*DELETE*)