From c251c791ff3feba9616326e404614d8f093744ed Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Wed, 11 Jun 2025 14:59:53 +0530 Subject: [PATCH] Fix pipe in get_sha256 --- src/scripts/unix.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/scripts/unix.sh b/src/scripts/unix.sh index 51d0f4bb..c013ee69 100644 --- a/src/scripts/unix.sh +++ b/src/scripts/unix.sh @@ -110,11 +110,11 @@ release_lock() { # Function to get the SHA256 hash of a string. get_sha256() { local input=$1 - if command -v sha256sum >/dev/null 2>&1; then + if command -v sha256sum >/dev/null; then printf '%s' "$input" | sha256sum | cut -d' ' -f1 - elif command -v shasum >/dev/null 2>&1; then + elif command -v shasum >/dev/null; then printf '%s' "$input" | shasum -a 256 | cut -d' ' -f1 - elif command -v openssl >/dev/null 2>&1; then + elif command -v openssl >/dev/null; then printf '%s' "$input" | openssl dgst -sha256 | cut -d' ' -f2 fi }