refactor $LINK checking

This commit is contained in:
NRK
2021-05-01 02:56:50 +06:00
parent 21062ccec8
commit 4007e22c28

5
sxbm
View File

@ -152,9 +152,10 @@ bm_open(){
esac
done
[ -z "$LINK" ] && die "No links found"
local LINK_NUM=$( printf "$LINK" | wc -l )
[ -n "$LINK" ] &&
local LINK_NUM=$( printf "$LINK" | wc -l ) ||
die "No links found"
if [ "$LINK_NUM" -gt 0 ]; then
die "Too many links\nUse 'sxbm open -f' to force open them all\n\n$(bm_list "-c" "$@")"