From 6c4aec4010dfa2969a4f645055f2e6920669320a Mon Sep 17 00:00:00 2001 From: Ciprian Mandache Date: Fri, 14 Jun 2024 03:31:26 +0300 Subject: [PATCH] rm ez-pre-commit script --- pre-commit.sh | 41 ----------------------------------------- 1 file changed, 41 deletions(-) delete mode 100755 pre-commit.sh diff --git a/pre-commit.sh b/pre-commit.sh deleted file mode 100755 index db0165b..0000000 --- a/pre-commit.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash - -# Log the start of the script -echo "Running pre-commit script..." - -# Determine the latest git tag -latest_tag=$(git describe --tags --abbrev=0) -if [ -z "$latest_tag" ]; then - echo "No tags found." - exit 0 -fi - -echo "Latest git tag is: $latest_tag" - -# Log checking the pyproject.toml -echo "Checking for version mismatch in pyproject.toml..." - -# Define the location of pyproject.toml -PYPROJECT_TOML="./pyproject.toml" - -# Check if the pyproject.toml exists -if [ ! -f "$PYPROJECT_TOML" ]; then - echo "[ez-pre-commit] Missing pyproject.toml file. Cannot check version." - exit 1 -fi - -# Extract the version from pyproject.toml -pyproject_version=$(awk -F' = ' '/^version = / {gsub(/"/, "", $2); print $2}' $PYPROJECT_TOML) - -# Log the version found -echo "Version in pyproject.toml is: $pyproject_version" - -# Compare versions -if [ "$latest_tag" != "$pyproject_version" ]; then - echo "[ez-pre-commit] Version mismatch! Tag: $latest_tag does not match pyproject.toml: $pyproject_version" - exit 1 -else - echo "Versions match. All good!" -fi - -exit 0