From e6be07d3e2c55861524751572168511813315606 Mon Sep 17 00:00:00 2001 From: Guiorgy Date: Mon, 2 Feb 2026 01:03:50 +0400 Subject: [PATCH] stop grep after first match From the grep man page: -m NUM Stop reading a file after NUM matching lines. The redirect of the rest of the pipe input to /dev/null is to avoid curl panicking with code 23 due to the pipe closing prematurely --- install.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/install.sh b/install.sh index e6a4a6b..c3c5fe7 100644 --- a/install.sh +++ b/install.sh @@ -82,8 +82,7 @@ echo "--------------------------------------------" ############################################### LATEST_TAG="$( curl -fsSL "https://api.github.com/repos/${REPO}/releases/latest" \ - | grep '"tag_name"' \ - | head -n1 \ + | { grep -m1 '"tag_name"' && cat >/dev/null; } \ | cut -d '"' -f4 )"