You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nlpcraft.apache.org by ar...@apache.org on 2020/08/27 06:31:24 UTC
[incubator-nlpcraft] branch NLPCRAFT-108 updated: WIP on various
scripts.
This is an automated email from the ASF dual-hosted git repository.
aradzinski pushed a commit to branch NLPCRAFT-108
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git
The following commit(s) were added to refs/heads/NLPCRAFT-108 by this push:
new 6728dd6 WIP on various scripts.
6728dd6 is described below
commit 6728dd6f3e428353bbefd08ec8294a3467fdf9a2
Author: Aaron Radzinski <ar...@datalingvo.com>
AuthorDate: Wed Aug 26 23:26:22 2020 -0700
WIP on various scripts.
---
bin/nccurl.sh | 1 +
bin/nlpcraft.sh | 30 ++++++++++++++++++++++++------
2 files changed, 25 insertions(+), 6 deletions(-)
diff --git a/bin/nccurl.sh b/bin/nccurl.sh
index aaf25a5..efbcb80 100755
--- a/bin/nccurl.sh
+++ b/bin/nccurl.sh
@@ -35,4 +35,5 @@ abort() {
[ -x "$(command -v curl)" ] || abort "'curl' not found."
[ -x "$(command -v python3)" ] || abort "'python3' not found."
+# shellcheck disable=SC2086
curl -s -d "$2" -H 'Content-Type: application/json' http://localhost:8081/api/v1/$1 | python3 -m json.tool
diff --git a/bin/nlpcraft.sh b/bin/nlpcraft.sh
index 7f14aa8..b9e7d69 100644
--- a/bin/nlpcraft.sh
+++ b/bin/nlpcraft.sh
@@ -25,7 +25,7 @@ SCRIPT_NAME="$(basename "$0")"
INSTALL_HOME="$(dirname "$SCRIPT_HOME")"
# Directory containing JARs.
-BUILD_HOME="$SCRIPT_HOME/build"
+BUILD_HOME="$INSTALL_HOME/build"
# Mac OS specific support to display correct name in the dock.
if [ "${DOCK_OPTS:-}" == "" ]; then
@@ -98,19 +98,37 @@ JVM_OPTS="\
-XX:MaxMetaspaceSize=256m \
-DNLPCRAFT_CLI_SCRIPT=$SCRIPT_NAME \
-DNLPCRAFT_CLI_INSTALL_HOME=$INSTALL_HOME"
-CP="$BUILD_HOME/*.jar"
+osname=$(uname)
+
+# OS specific classpath separator.
+SEP=":"
+
+case "${osname}" in
+ MINGW*)
+ SEP=";"
+ ;;
+ CYGWIN*)
+ SEP=";"
+ ;;
+esac
+
+# Build classpath.
+for file in "$BUILD_HOME"/*.jar
+do
+ CP=$CP$SEP$file
+done
# Check Java version.
checkJava
-osname=$(uname)
-
case $osname in
Darwin*)
- "$JAVA" "$JVM_OPTS" "$DOCK_OPTS" -cp "${CP}" $MAIN_CLASS "$@"
+ # shellcheck disable=SC2086
+ "$JAVA" $JVM_OPTS "$DOCK_OPTS" -cp "${CP}" $MAIN_CLASS "$@"
;;
*)
- "$JAVA" "$JVM_OPTS" -cp "${CP}" $MAIN_CLASS "$@"
+ # shellcheck disable=SC2086
+ "$JAVA" $JVM_OPTS -cp "${CP}" $MAIN_CLASS "$@"
;;
esac
\ No newline at end of file