From a6d84e4d8b7a29a86cc57f6171f77b2630098bc7 Mon Sep 17 00:00:00 2001 From: Daniel Kuppitz Date: Wed, 28 Sep 2016 22:13:56 +0200 Subject: [PATCH] Tweaked `gremlin.sh` so that it can be started from anywhere. Removed all shell script that just forwarded the command to another script and added symlinks instead. --- bin/gremlin.sh | 23 +------------------ docs/src/dev/developer/release.asciidoc | 4 +++- gremlin-console/bin/gremlin.sh | 25 +-------------------- gremlin-console/src/main/bin/gremlin.sh | 30 +++++++++++++++---------- 4 files changed, 23 insertions(+), 59 deletions(-) mode change 100755 => 120000 bin/gremlin.sh mode change 100755 => 120000 gremlin-console/bin/gremlin.sh diff --git a/bin/gremlin.sh b/bin/gremlin.sh deleted file mode 100755 index 512f71f9a5a..00000000000 --- a/bin/gremlin.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -# -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# - -`dirname $0`/../gremlin-console/bin/gremlin.sh $@ diff --git a/bin/gremlin.sh b/bin/gremlin.sh new file mode 120000 index 00000000000..e99f01daa4e --- /dev/null +++ b/bin/gremlin.sh @@ -0,0 +1 @@ +../gremlin-console/bin/gremlin.sh \ No newline at end of file diff --git a/docs/src/dev/developer/release.asciidoc b/docs/src/dev/developer/release.asciidoc index f9baa94b134..b066dd07bf8 100644 --- a/docs/src/dev/developer/release.asciidoc +++ b/docs/src/dev/developer/release.asciidoc @@ -75,11 +75,13 @@ might be high. .. `mvn verify -DskipPerformanceTests=false` . `bin/publish-docs.sh ` - note that under a release candidate the documentation is published as SNAPSHOT . `mvn versions:set -DnewVersion=xx.yy.zz -DgenerateBackupPoms=false` to update the project files to reference a non-SNAPSHOT version +. `pushd gremlin-console/bin; ln -fs ../target/apache-tinkerpop-gremlin-console-xx.yy.zz-standalone/bin/gremlin.sh gremlin.sh; popd` . `git diff` and review the updated files (expect all `pom.xml` files and this README) . `git commit -a -m "TinkerPop xx.yy.zz release"` and `git push` . `git tag -a -m "TinkerPop xx.yy.zz release" xx.yy.zz` and `git push --tags` . `mvn clean install` . `mvn versions:set -DnewVersion=xx.yy.zz-SNAPSHOT -DgenerateBackupPoms=false` to go back to SNAPSHOT +. `pushd gremlin-console/bin; ln -fs ../target/apache-tinkerpop-gremlin-console-xx.yy.zz-SNAPSHOT-standalone/bin/gremlin.sh gremlin.sh; popd` . `git commit -a -m "Returned to xx.yy.zz-SNAPSHOT"` and `git push` . Announce the release candidate to `dev` mailing list and await feedback . Repeat as required or proceed to the next phase @@ -267,4 +269,4 @@ The Central Maven repo has sync'd as well: https://repo1.maven.org/maven2/org/apache/tinkerpop/tinkerpop/xx.yy.zz/ [include the release line logo image] ----- \ No newline at end of file +---- diff --git a/gremlin-console/bin/gremlin.sh b/gremlin-console/bin/gremlin.sh deleted file mode 100755 index d0d3240e6c5..00000000000 --- a/gremlin-console/bin/gremlin.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -# -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# - -OPTS=$@ -set JAVA_OPTIONS="-Dtinkerpop.ext=/../target/apache-tinkerpop-gremlin-*-standalone/ext -Dlog4j.configuration=conf/log4j-console.properties -Dgremlin.log4j.level=$GREMLIN_LOG_LEVEL" -`dirname $0`/../target/apache-tinkerpop-gremlin-*-standalone/bin/gremlin.sh $OPTS diff --git a/gremlin-console/bin/gremlin.sh b/gremlin-console/bin/gremlin.sh new file mode 120000 index 00000000000..582587975ae --- /dev/null +++ b/gremlin-console/bin/gremlin.sh @@ -0,0 +1 @@ +../target/apache-tinkerpop-gremlin-console-3.1.5-SNAPSHOT-standalone/bin/gremlin.sh \ No newline at end of file diff --git a/gremlin-console/src/main/bin/gremlin.sh b/gremlin-console/src/main/bin/gremlin.sh index 84ba81791bf..acd10282cc3 100755 --- a/gremlin-console/src/main/bin/gremlin.sh +++ b/gremlin-console/src/main/bin/gremlin.sh @@ -23,7 +23,20 @@ set -e set -u DIR="$( cd -P "$( dirname "$0" )" && pwd )" -SYSTEM_EXT_DIR="${DIR}/../ext" + +SOURCE="${BASH_SOURCE[0]}" +while [ -h "$SOURCE" ]; do + DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + SOURCE="$(readlink "$SOURCE")" + [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" +done + +WORKING_DIR="$( cd -P "${DIR}/.." && pwd )" +SYSTEM_EXT_DIR="${WORKING_DIR}/ext" + +pushd ${WORKING_DIR} +# > /dev/null + JAVA_OPTIONS=${JAVA_OPTIONS:-} if [ ! -z "${JAVA_OPTIONS}" ]; then @@ -36,21 +49,12 @@ fi case `uname` in CYGWIN*) - CP="`dirname $0`"/../config - CP="$CP":$( echo `dirname $0`/../lib/*.jar . | sed 's/ /;/g') + CP="$CP";$( echo lib/*.jar . | sed 's/ /;/g') ;; *) - CP="`dirname $0`"/../config - CP="$CP":$( echo `dirname $0`/../lib/*.jar . | sed 's/ /:/g') + CP="$CP":$( echo lib/*.jar . | sed 's/ /:/g') esac -SOURCE="${BASH_SOURCE[0]}" -while [ -h "$SOURCE" ]; do - DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" - SOURCE="$(readlink "$SOURCE")" - [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" -done - CP=$CP:$( find -L "${SYSTEM_EXT_DIR}" "${USER_EXT_DIR:-${SYSTEM_EXT_DIR}}" -mindepth 1 -maxdepth 1 -type d | \ sort -u | sed 's/$/\/plugin\/*/' | tr '\n' ':' ) @@ -111,3 +115,5 @@ fi # Start the JVM, execute the application, and return its exit code exec $JAVA $JAVA_OPTIONS $MAIN_CLASS "$@" + +popd > /dev/null