Skip to content

Commit 6fb2c45

Browse files
committed
fix: use && || flow control and bump version
1 parent ad6caa8 commit 6fb2c45

1 file changed

Lines changed: 4 additions & 9 deletions

File tree

ani-cli

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22

3-
version_number="4.14.0"
3+
version_number="4.14.1"
44

55
# UI
66

@@ -348,11 +348,8 @@ process_hist_entry() {
348348
latest_ep=$(printf "%s\n" "$ep_list" | tail -n1)
349349
title=$(printf "%s\n" "$title" | sed "s|[0-9]\+ episodes|${latest_ep} episodes|")
350350
ep_no=$(printf "%s" "$ep_list" | sed -n "/^${ep_no}$/{n;p;}") 2>/dev/null
351-
if [ -n "$ep_no" ]; then
352-
printf "%s\t%s - episode %s\n" "$id" "$title" "$ep_no"
353-
else
354-
printf "%s\t%s - episode %s (up to date)\n" "$id" "$title" "$latest_ep"
355-
fi
351+
[ -n "$ep_no" ] && printf "%s\t%s - episode %s\n" "$id" "$title" "$ep_no"
352+
[ -n "$ep_no" ] || printf "%s\t%s - episode %s (up to date)\n" "$id" "$title" "$latest_ep"
356353
}
357354

358355
update_history() {
@@ -598,9 +595,7 @@ case "$search" in
598595
ep_list=$(episodes_list "$id")
599596
ep_no=$(printf "%s" "$anime_list" | grep "$id" | cut -f2 | sed -nE 's/.*- episode (.+)$/\1/p')
600597
allanime_title="$(printf "%s" "$title" | cut -d'(' -f1 | tr -d '[:punct:]')"
601-
if printf "%s" "$anime_list" | grep "$id" | cut -f2 | grep -q "(up to date)"; then
602-
time_until_next_ep "$allanime_title"
603-
fi
598+
printf "%s" "$anime_list" | grep "$id" | cut -f2 | grep -q "(up to date)" && time_until_next_ep "$allanime_title"
604599
;;
605600
*)
606601
if [ "$use_external_menu" = "0" ]; then

0 commit comments

Comments
 (0)