From 411d9ef9b91dd3403411dfcf117e8f7afa6031bb Mon Sep 17 00:00:00 2001 From: Peter Donald Date: Fri, 15 Dec 2000 09:16:43 +0000 Subject: [PATCH] Automagic detection of ANT_HOME for windows NT/2000 Submitted by: "Vincent Bergbauer" via Louis Tribble git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@268357 13f79535-47bb-0310-9956-ffa450edef68 --- src/bin/ant.bat | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/bin/ant.bat b/src/bin/ant.bat index cfdda0a7c..1f8e9c488 100755 --- a/src/bin/ant.bat +++ b/src/bin/ant.bat @@ -2,6 +2,19 @@ if exist "%HOME%\antrc_pre.bat" call "%HOME%\antrc_pre.bat" +if not "%OS%"=="Windows_NT" goto start + +rem %~dp0 is name of current script under NT +set DEFAULT_ANT_HOME=%~dp0 + +rem : operator works similar to make : operator +set DEFAULT_ANT_HOME=%DEFAULT_ANT_HOME:\bin\=% + +if "%ANT_HOME%"=="" set ANT_HOME=%DEFAULT_ANT_HOME% +set DEFAULT_ANT_HOME= + +:start + rem Slurp the command line arguments. This loop allows for an unlimited number of rem agruments (up to the command line limit, anyway).