aboutsummaryrefslogtreecommitdiff
path: root/1337x
diff options
context:
space:
mode:
authorsinanmohd <sinan@firemail.cc>2023-05-08 11:21:15 +0530
committersinanmohd <sinan@firemail.cc>2023-05-08 12:05:46 +0530
commitd5ef702213ebaf7c08d7a62dbc68625f2a1f2e04 (patch)
tree6840db3ac5b42f7eef9ba3a78a3ab717460e02f7 /1337x
parent0e942d035d09b04d88cb018d22b8ce6aa4f4283b (diff)
1337x, yts: exit quietly if query is empty
Diffstat (limited to '1337x')
-rwxr-xr-x1337x10
1 files changed, 4 insertions, 6 deletions
diff --git a/1337x b/1337x
index 2005440..aeacf3c 100755
--- a/1337x
+++ b/1337x
@@ -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"