IGNITE-6535 Web Console: Set IGNITE_HOME for Web Agent.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/4cb0fc73 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/4cb0fc73 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/4cb0fc73 Branch: refs/heads/ignite-3478 Commit: 4cb0fc73f4129895e975c6a2381c5059e3f6e1ce Parents: 0919d9f Author: Alexey Kuznetsov <[email protected]> Authored: Sun Oct 1 18:47:08 2017 +0700 Committer: Alexey Kuznetsov <[email protected]> Committed: Mon Oct 2 13:56:21 2017 +0700 ---------------------------------------------------------------------- .../web-agent/bin/ignite-web-agent.bat | 19 +++++++++++++++++++ .../web-agent/bin/ignite-web-agent.sh | 5 +++++ 2 files changed, 24 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/4cb0fc73/modules/web-console/web-agent/bin/ignite-web-agent.bat ---------------------------------------------------------------------- diff --git a/modules/web-console/web-agent/bin/ignite-web-agent.bat b/modules/web-console/web-agent/bin/ignite-web-agent.bat index 1f1b52d..387447f 100644 --- a/modules/web-console/web-agent/bin/ignite-web-agent.bat +++ b/modules/web-console/web-agent/bin/ignite-web-agent.bat @@ -20,6 +20,25 @@ Setlocal EnableDelayedExpansion if "%OS%" == "Windows_NT" setlocal +:: Check IGNITE_HOME. +pushd "%~dp0" +set IGNITE_HOME=%CD% + +:checkIgniteHome2 +:: Strip double quotes from IGNITE_HOME +set IGNITE_HOME=%IGNITE_HOME:"=% + +:: remove all trailing slashes from IGNITE_HOME. +if %IGNITE_HOME:~-1,1% == \ goto removeTrailingSlash +if %IGNITE_HOME:~-1,1% == / goto removeTrailingSlash +goto checkIgniteHome3 + +:removeTrailingSlash +set IGNITE_HOME=%IGNITE_HOME:~0,-1% +goto checkIgniteHome2 + +:checkIgniteHome3 + :: Check JAVA_HOME. if defined JAVA_HOME goto checkJdk echo %0, ERROR: http://git-wip-us.apache.org/repos/asf/ignite/blob/4cb0fc73/modules/web-console/web-agent/bin/ignite-web-agent.sh ---------------------------------------------------------------------- diff --git a/modules/web-console/web-agent/bin/ignite-web-agent.sh b/modules/web-console/web-agent/bin/ignite-web-agent.sh index c2958fc..530bc7f 100644 --- a/modules/web-console/web-agent/bin/ignite-web-agent.sh +++ b/modules/web-console/web-agent/bin/ignite-web-agent.sh @@ -60,6 +60,11 @@ fi SOURCE="${BASH_SOURCE[0]}" +# +# Set IGNITE_HOME. +# +export IGNITE_HOME="$(dirname "$(cd "$(dirname "$0")"; "pwd")")"; + DIR="$( dirname "$SOURCE" )" while [ -h "$SOURCE" ]
