yait

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 852b590567b71c66e6853a24c738a2523559e842
parent 5eb479589efc06752f5febfafb160809c31c01ad
Author: vx-clutch <[email protected]>
Date:   Thu,  8 Jan 2026 17:18:53 +0000

update pre-commit

Diffstat:
Mscripts/git-hooks/pre-commit | 24++++++++++++++++--------
1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/scripts/git-hooks/pre-commit b/scripts/git-hooks/pre-commit @@ -1,16 +1,24 @@ -#! /bin/sh +#!/bin/sh # -# Run pre commit checks on bin/yait. Requires `shellcheck` as well as a POSIX -# shell (duh) +# Run pre-commit checks on bin/yait. Requires `shellcheck` and a POSIX +# shell (duh). + +me=$(basename "$0") + +fmt() { + echo "${me}[$$]: $*" +} script_path="./bin/yait" if git diff --cached --name-only | grep -q "$script_path"; then - if ! shellcheck "$script_path"; then - echo "[$0]: Syntax errors found in $script_path. Commit aborted." - exit 1 - fi + if shellcheck --enable=all --shell=sh "$script_path"; then + fmt "All tests passed." + exit 0 + else + fmt "Syntax errors found in $script_path. Commit aborted." + exit 1 + fi fi -echo "[$0] All Tests Pass" exit 0