From e927c9a3aeea8c8a429a68e1bbbec0dfbace1081 Mon Sep 17 00:00:00 2001 From: Lilith Date: Fri, 27 Feb 2026 22:45:55 -0800 Subject: [PATCH] =?UTF-8?q?ci(git-hooks):=20=F0=9F=91=B7=20Update=20pre-pu?= =?UTF-8?q?sh=20hooks=20to=20enforce=20code=20quality=20checks=20before=20?= =?UTF-8?q?allowing=20pushes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Lilith Autocommit --- .githooks/pre-push | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.githooks/pre-push b/.githooks/pre-push index c26900c..213d668 100755 --- a/.githooks/pre-push +++ b/.githooks/pre-push @@ -55,7 +55,7 @@ if [[ ! -f "$PACKAGE_JSON" ]]; then fi # Extract current version using portable tools -CURRENT_VERSION=$(grep -o '"version"[[:space:]]*:[[:space:]]*"[^"]*"' "$PACKAGE_JSON" | head -1 | sed 's/.*"\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)".*/\1/') +CURRENT_VERSION=$(grep -o '"version"[[:space:]]*:[[:space:]]*"[^"]*"' "$PACKAGE_JSON" | head -1 | sed 's/.*"\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/') if [[ -z "$CURRENT_VERSION" ]]; then log_error "Could not parse version from package.json" @@ -74,10 +74,10 @@ log_info "Pushing to $BRANCH - bumping version: $CURRENT_VERSION -> $NEW_VERSION # Update package.json (preserve formatting, just replace version) if [[ "$(uname)" == "Darwin" ]]; then # macOS sed requires empty string for -i - sed -i '' "s/\"version\"[[:space:]]*:[[:space:]]*\"$CURRENT_VERSION\"/\"version\": \"$NEW_VERSION\"/" "$PACKAGE_JSON" + sed -i '' "s/\"version\"[[:space:]]*:[[:space:]]*\"$CURRENT_VERSION[^\"]*\"/\"version\": \"$NEW_VERSION\"/" "$PACKAGE_JSON" else # GNU sed - sed -i "s/\"version\"[[:space:]]*:[[:space:]]*\"$CURRENT_VERSION\"/\"version\": \"$NEW_VERSION\"/" "$PACKAGE_JSON" + sed -i "s/\"version\"[[:space:]]*:[[:space:]]*\"$CURRENT_VERSION[^\"]*\"/\"version\": \"$NEW_VERSION\"/" "$PACKAGE_JSON" fi log_info "Updated $PACKAGE_JSON"