diff options
author | sinanmohd <sinan@firemail.cc> | 2023-05-08 11:21:15 +0530 |
---|---|---|
committer | sinanmohd <sinan@firemail.cc> | 2023-05-08 12:05:46 +0530 |
commit | d5ef702213ebaf7c08d7a62dbc68625f2a1f2e04 (patch) | |
tree | 6840db3ac5b42f7eef9ba3a78a3ab717460e02f7 /1337x | |
parent | 0e942d035d09b04d88cb018d22b8ce6aa4f4283b (diff) |
1337x, yts: exit quietly if query is empty
Diffstat (limited to '1337x')
-rwxr-xr-x | 1337x | 10 |
1 files changed, 4 insertions, 6 deletions
@@ -60,8 +60,7 @@ main() [ -z "$WAYLAND_DISPLAY" ] && menu="dmenu" - if [ "$#" -gt 0 ] && [ "$1" = "-o" ] - then + if [ "$#" -gt 0 ] && [ "$1" = "-o" ]; then out=true shift fi @@ -70,17 +69,16 @@ main() query="${*:-$(printf "" | "$menu" -p " ")}" [ -z "$query" ] && - die "please enter a query" + exit 1 fetch="$(search_1337x "$query")" select="$(echo "$fetch" | sed -e's/^.*\///g' | tr '-' ' ' | "$menu" -l 25 -p " " | tr ' ' '-')" magnet="$(magnet_1337x "$(echo "$fetch" | grep "$select")")" [ -z "$magnet" ] && - die "empty magnet" + die "empty torrent magnet" - if [ "$out" = true ] - then + if [ "$out" = true ]; then echo "$magnet" else dep_check "pirowatch" |