mirror of
https://github.com/LukeSmithxyz/voidrice.git
synced 2026-03-20 01:37:45 +01:00
Combine the exit conditions to make it minimal.
This commit is contained in:
parent
410f6bb894
commit
f20ddd722c
@ -2,15 +2,9 @@
|
||||
|
||||
FILE="~/.local/share/larbs/urlquery"
|
||||
|
||||
OBJ_SELECTED=$(jq -r ".[][0]" "$FILE" | dmenu -l 10 -p "Select a website")
|
||||
|
||||
if [ -z "$OBJ_SELECTED" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
ENTRY_EXISTS=$(jq -r --arg sel "$OBJ_SELECTED" 'map(.[0] == $sel) | any' "$FILE")
|
||||
|
||||
if [ "$ENTRY_EXISTS" = "false" ] && [ "$OBJ_SELECTED" != "@@" ]; then
|
||||
if [ -z "$OBJ_SELECTED" ] || ([ "$ENTRY_EXISTS" = "false" ] && [ "$OBJ_SELECTED" != "@@" ]); then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user