From 12916fbb0ef8e90a1eddf13f4db12f656c59d63e Mon Sep 17 00:00:00 2001 From: Jamie-SA Date: Thu, 24 Apr 2025 19:09:12 -0600 Subject: [PATCH 1/3] Support java executable in path --- tools/serializer/pre-commit | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/tools/serializer/pre-commit b/tools/serializer/pre-commit index 53b2a4e4..4a42cbfd 100755 --- a/tools/serializer/pre-commit +++ b/tools/serializer/pre-commit @@ -38,16 +38,11 @@ function findJava() { java_home="" - if [ "${RDF_TOOLKIT_JAVA_HOME}" != "" ] ; then - java_home="${RDF_TOOLKIT_JAVA_HOME}" - fi if [ "${JAVA_HOME}" != "" ] ; then java_home="${JAVA_HOME}" fi - if [ "${java_home}" == "" ] ; then - log_error A-$JAVA_HOME - log_error "Please set RDF_TOOLKIT_JAVA_HOME or JAVA_HOME to point to a Java ${min_java} or later installation." - return 1 + if [ "${RDF_TOOLKIT_JAVA_HOME}" != "" ] ; then + java_home="${RDF_TOOLKIT_JAVA_HOME}" fi java_home=${java_home/C:\\/\/c\/} java_home=${java_home//\\/\/} @@ -55,6 +50,8 @@ function findJava() { if [ -x "${java_home}/bin/java" ] ; then whichJava="${java_home}/bin/java" + elif [ -x `which java` ] ; then + whichJava=`which java` else log_error "Could not find java in your RDF_TOOLKIT_JAVA_HOME or JAVA_HOME: ${java_home}." log_error "Please set RDF_TOOLKIT_JAVA_HOME or JAVA_HOME to point to a Java ${min_java} or later installation." @@ -146,13 +143,13 @@ function serialize() { esac log "Target format is $tfmt" - - if [[ $file =~ .*About.* ]] ; then + + if [[ $file =~ .*About.* ]] ; then log "Skipping unsupported file $file" return 0 fi - if [[ $file =~ .*OWL.* ]] ; then + if [[ $file =~ .*OWL.* ]] ; then log "Skipping unsupported file $file" return 0 fi @@ -185,7 +182,7 @@ __log_config__ --use-dtd-subset \ --string-data-typing explicit \ --suppress-named-individuals \ - --inline-blank-nodes + --inline-blank-nodes rc=$? set +x From b312f5f2e56a5156fdb020e8a21a46762b4f5f57 Mon Sep 17 00:00:00 2001 From: Jamie-SA Date: Thu, 24 Apr 2025 19:23:37 -0600 Subject: [PATCH 2/3] Add release note --- docs/release_notes/issue1214-improve-pre-commit-hook | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 docs/release_notes/issue1214-improve-pre-commit-hook diff --git a/docs/release_notes/issue1214-improve-pre-commit-hook b/docs/release_notes/issue1214-improve-pre-commit-hook new file mode 100644 index 00000000..2ce85295 --- /dev/null +++ b/docs/release_notes/issue1214-improve-pre-commit-hook @@ -0,0 +1,5 @@ +### Patch Updates + +- Changes to the pre-commit hook. Issue [1214](https://github.com/semanticarts/gist/issues/1214). + - Prefer RDF_TOOLKIT_JAVA_HOME over JAVA_HOME, since it is the more specific name. + - If neither of those work, use a java executable if one is available in the PATH. From 231684cb0ac3a816b3d7c226d96ef221392d4eb2 Mon Sep 17 00:00:00 2001 From: Jamie-SA <45212760+Jamie-SA@users.noreply.github.com> Date: Tue, 6 May 2025 17:12:35 -0600 Subject: [PATCH 3/3] Update docs/release_notes/issue1214-improve-pre-commit-hook Co-authored-by: Rebecca Younes --- docs/release_notes/issue1214-improve-pre-commit-hook | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/release_notes/issue1214-improve-pre-commit-hook b/docs/release_notes/issue1214-improve-pre-commit-hook index 2ce85295..dceddb31 100644 --- a/docs/release_notes/issue1214-improve-pre-commit-hook +++ b/docs/release_notes/issue1214-improve-pre-commit-hook @@ -1,5 +1,5 @@ ### Patch Updates -- Changes to the pre-commit hook. Issue [1214](https://github.com/semanticarts/gist/issues/1214). +- Made changes to the pre-commit hook. Issue [1214](https://github.com/semanticarts/gist/issues/1214). - Prefer RDF_TOOLKIT_JAVA_HOME over JAVA_HOME, since it is the more specific name. - - If neither of those work, use a java executable if one is available in the PATH. + - If neither of those work, use a Java executable if one is available in the PATH.