From de0ea3b2f839c2f6ba074d7401d2a28118680da0 Mon Sep 17 00:00:00 2001 From: Levente Polyak Date: Thu, 29 Feb 2024 00:43:26 +0100 Subject: fix(version): do not prompt for input on terminal during check In certain scenarios, like when an URL is checked that asks for credentials or other kind of input, the process blocks and waits for stdin input. This isn't particularly useful during scripted execution and in our cases also just an indicator for like a none existing GitHub repository. To avoid this situation, disable git terminal prompts. Component: pkgctl version check Signed-off-by: Levente Polyak --- src/lib/version/check.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/version/check.sh b/src/lib/version/check.sh index 6cd4a5b..ec90eb4 100644 --- a/src/lib/version/check.sh +++ b/src/lib/version/check.sh @@ -223,7 +223,7 @@ get_upstream_version() { opts+=(--keyfile "${keyfile}") fi - if ! output=$(nvchecker --file "${config}" --logger json "${opts[@]}" 2>&1 | \ + if ! output=$(GIT_TERMINAL_PROMPT=0 nvchecker --file "${config}" --logger json "${opts[@]}" 2>&1 | \ jq --raw-output 'select(.level != "debug")'); then printf "failed to run nvchecker: %s" "${output}" return 1 -- cgit v1.2.3-54-g00ecf