Skip to content

Commit 38b0315

Browse files
committed
Use POSIX-compatible syntax
1 parent a735197 commit 38b0315

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lizard.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ NLOC_LIMIT=250
2424
FILES=$(git diff --cached --name-only --diff-filter=ACM | grep -E '\.tsx$|\.ts$')
2525

2626
# Check if there are any files to analyze
27-
if [[ -z "$FILES" ]]; then
27+
if [ -z "$FILES" ]; then
2828
echo "No Typescript files to check"
2929
exit 0 # No files to check, allow commit
3030
fi
@@ -40,13 +40,13 @@ for FILE in $FILES; do
4040
OUTPUT=$(lizard -C $COMPLEXITY_LIMIT -Tnloc=$NLOC_LIMIT -w --warning-msvs "$FILE")
4141
ERROR_CODE=$?
4242

43-
if [[ "$ERROR_CODE" -ne 0 ]]; then
43+
if [ "$ERROR_CODE" -ne 0 ]; then
4444
ERROR_LIST+="$OUTPUT\n"
4545
fi
4646
done
4747

4848
# Check if there were any errors
49-
if [[ -n "$ERROR_LIST" ]]; then
49+
if [ -n "$ERROR_LIST" ]; then
5050
echo "❌ Commit aborted due to the errors in the following files:"
5151
echo "$ERROR_LIST"
5252
echo "Limits are: Code Complexity (CCN)=$COMPLEXITY_LIMIT and Number of Lines (NLOC)=$NLOC_LIMIT"

0 commit comments

Comments
 (0)