From 2d398b8dcf3d0cc8458e6aed303cf9fbcac4f029 Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Mon, 6 Jun 2016 11:05:05 +0200 Subject: [PATCH] repl: cd into PROJECT_ROOT --- repl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/repl b/repl index c4a3f7afd..436f62271 100755 --- a/repl +++ b/repl @@ -3,6 +3,7 @@ set -e set -u set -o pipefail + while getopts d OPTION "$@"; do case $OPTION in d) @@ -11,6 +12,9 @@ while getopts d OPTION "$@"; do esac done +PROJECT_ROOT=$(dirname "${BASH_SOURCE[0]}") +cd "${PROJECT_ROOT}" + echo "Compiling and computing classpath (May take a while)" # Sadly even with the --quiet option Gradle (or some component of) # will print the number of warnings/errors to stdout if there are @@ -19,7 +23,7 @@ echo "Compiling and computing classpath (May take a while)" # /smack/smack-repl/build/classes/main:/smack/smack-repl/build/ # resources/main:/smack/smack-tcp/build/libs/smack-tcp-4.2.0-alpha4-SNAPSHOT.jar # So perform a "tail -n1" on the output of gradle -declare -r GRADLE_CLASSPATH="$(gradle :smack-repl:printClasspath --quiet |\ +GRADLE_CLASSPATH="$(gradle :smack-repl:printClasspath --quiet |\ tail -n1)" echo "Finished, starting REPL"