Skip to content

Commit

Permalink
fix pre-commit hook
Browse files Browse the repository at this point in the history
  • Loading branch information
jcmelati committed Feb 11, 2025
1 parent d33ff2a commit dbaff3d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
18 changes: 15 additions & 3 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,24 @@
export MSYS=winsymlinks:nativestrict
export MSYS2=winsymlinks:nativestrict

# Get the commit message from the commit being created
COMMIT_MSG=$(cat "$1")

# Get the commit message from the temporary file
if [ ! -f .git/COMMIT_EDITMSG ]; then
echo "Error: Commit message file not found"
exit 1
fi
COMMIT_MSG=$(cat .git/COMMIT_EDITMSG)
# Get the current version from build.gradle.kts
if [ ! -f build.gradle.kts ]; then
echo "Error: build.gradle.kts not found"
exit 1
fi
CURRENT_VERSION=$(grep 'version = ' build.gradle.kts | sed 's/.*version = "\(.*\)".*/\1/')

if [ -z "$CURRENT_VERSION" ]; then
echo "Error: Could not find version in build.gradle.kts"
exit 1
fi

# Remove -SNAPSHOT if present
VERSION_BASE=${CURRENT_VERSION%-SNAPSHOT}

Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ fun getNpmVersion(): String {

allprojects {
group = "com.sphereon.oid.fed"
version = "0.4.18-SNAPSHOT"
version = "0.4.19-SNAPSHOT"
val npmVersion by extra { getNpmVersion() }

// Common repository configuration for all projects
Expand Down

0 comments on commit dbaff3d

Please sign in to comment.