From 95db89f3c9d4c7cf80c4fe21f8de5f3457923611 Mon Sep 17 00:00:00 2001 From: Akianonymus Date: Thu, 4 Aug 2022 18:40:28 +0530 Subject: [PATCH] common-utils: assert_regex: Do not check if string is empty Totally defies the logic here --- release/bash/gdl | 2 +- release/sh/gdl | 4 ++-- src/bash/common-utils.bash | 2 +- src/sh/common-utils.sh | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/release/bash/gdl b/release/bash/gdl index 371c180..3b081b1 100755 --- a/release/bash/gdl +++ b/release/bash/gdl @@ -2,7 +2,7 @@ SELF_SOURCE="true" set -a _assert_regex(){ -declare pattern="${1:?Error: Missing pattern}" string="${2:?Missing string}" +declare pattern="${1:-}" string="${2:-}" if [[ $string =~ $pattern ]];then return 0 else diff --git a/release/sh/gdl b/release/sh/gdl index 4007435..4f232c3 100755 --- a/release/sh/gdl +++ b/release/sh/gdl @@ -2,8 +2,8 @@ SELF_SOURCE="true" set -a _assert_regex(){ -grep -qE "${1:?Error: Missing pattern}" 0<