From d1d383a5a731abc3e7d1e5413ca05b874e84b84e Mon Sep 17 00:00:00 2001 From: Joshua Potter Date: Tue, 19 Dec 2023 05:48:06 -0700 Subject: [PATCH] Fixup pre-commits to use `=~` where not. --- specs/clang/template/.githooks/pre-commit | 2 +- specs/nodejs/template/.githooks/pre-commit | 2 +- specs/phoenix/template/.githooks/pre-commit | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/specs/clang/template/.githooks/pre-commit b/specs/clang/template/.githooks/pre-commit index 8a0f50e..aefe06d 100755 --- a/specs/clang/template/.githooks/pre-commit +++ b/specs/clang/template/.githooks/pre-commit @@ -10,7 +10,7 @@ STAGED=$( TARGETS=() while IFS= read -r FILENAME do - if [[ "$FILENAME" =~ .*\.c$ ]] || [[ "$FILENAME" == .*\.h$ ]]; then + if [[ "$FILENAME" =~ .*\.c$ ]] || [[ "$FILENAME" =~ .*\.h$ ]]; then TARGETS+=("${FILENAME}") fi done <<< "$STAGED" diff --git a/specs/nodejs/template/.githooks/pre-commit b/specs/nodejs/template/.githooks/pre-commit index 749f5d3..ecd5121 100755 --- a/specs/nodejs/template/.githooks/pre-commit +++ b/specs/nodejs/template/.githooks/pre-commit @@ -10,7 +10,7 @@ STAGED=$( TARGETS=() while IFS= read -r FILENAME do - if [[ "$FILENAME" =~ .*\.jsx?$ ]] || [[ "$FILENAME" == .*\.tsx?$ ]]; then + if [[ "$FILENAME" =~ .*\.jsx?$ ]] || [[ "$FILENAME" =~ .*\.tsx?$ ]]; then TARGETS+=("${FILENAME}") fi done <<< "$STAGED" diff --git a/specs/phoenix/template/.githooks/pre-commit b/specs/phoenix/template/.githooks/pre-commit index 78c222f..2eb706d 100755 --- a/specs/phoenix/template/.githooks/pre-commit +++ b/specs/phoenix/template/.githooks/pre-commit @@ -11,9 +11,9 @@ MIX_TARGETS=() WEB_TARGETS=() while IFS= read -r FILENAME do - if [[ "$FILENAME" =~ .*exs?$ ]]; then + if [[ "$FILENAME" =~ .*\.exs?$ ]]; then MIX_TARGETS+=("${FILENAME}") - elif [[ "$FILENAME" =~ .*jsx?$ ]] || [[ "$FILENAME" =~ .*tsx?$ ]]; then + elif [[ "$FILENAME" =~ .*\.jsx?$ ]] || [[ "$FILENAME" =~ .*\.tsx?$ ]]; then WEB_TARGETS+=("${FILENAME}") fi done <<< "$STAGED"