geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r539224 - /geronimo/sandbox/gshell/trunk/gshell-assembly/src/main/scripts/gsh.bat
Date Fri, 18 May 2007 02:42:12 GMT
Author: jdillon
Date: Thu May 17 19:42:11 2007
New Revision: 539224

URL: http://svn.apache.org/viewvc?view=rev&rev=539224
Log:
(GSHELL-29) Simplify the evil windows bat script

Modified:
    geronimo/sandbox/gshell/trunk/gshell-assembly/src/main/scripts/gsh.bat

Modified: geronimo/sandbox/gshell/trunk/gshell-assembly/src/main/scripts/gsh.bat
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-assembly/src/main/scripts/gsh.bat?view=diff&rev=539224&r1=539223&r2=539224
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-assembly/src/main/scripts/gsh.bat (original)
+++ geronimo/sandbox/gshell/trunk/gshell-assembly/src/main/scripts/gsh.bat Thu May 17 19:42:11
2007
@@ -22,99 +22,58 @@
 rem $Rev$ $Date$
 rem 
 
-@rem Set local scope for the variables with windows NT shell
 if "%OS%"=="Windows_NT" setlocal
 
 :begin
-@rem Determine what directory it is in.
+
 set DIRNAME=%~dp0
 if "%DIRNAME%" == "" set DIRNAME=.\
-
 if "%PROGNAME%" == "" set PROGNAME=gsh
 
-@rem Determine the command interpreter to execute the "CD" later
-set COMMAND_COM="cmd.exe"
-if exist "%SystemRoot%\system32\cmd.exe" set COMMAND_COM="%SystemRoot%\system32\cmd.exe"
-if exist "%SystemRoot%\command.com" set COMMAND_COM="%SystemRoot%\command.com"
-
-@rem Use explicit find.exe to prevent cygwin and others find.exe from being used
-set FIND_EXE="find.exe"
-if exist "%SystemRoot%\system32\find.exe" set FIND_EXE="%SystemRoot%\system32\find.exe"
-if exist "%SystemRoot%\command\find.exe" set FIND_EXE="%SystemRoot%\command\find.exe"
+:check_JAVACMD
+if not "%JAVACMD%" == "" goto check_GSHELL_HOME
 
 :check_JAVA_HOME
-@rem Make sure we have a valid JAVA_HOME
 if not "%JAVA_HOME%" == "" goto have_JAVA_HOME
-
-echo.
-echo ERROR: Environment variable JAVA_HOME has not been set.
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-echo.
-goto end
+set JAVACMD=java
+goto check_GSHELL_HOME
 
 :have_JAVA_HOME
-@rem Validate JAVA_HOME
-%COMMAND_COM% /C DIR "%JAVA_HOME%" 2>&1 | %FIND_EXE% /I /C "%JAVA_HOME%" >nul
-if not errorlevel 1 goto check_GSHELL_HOME
-
-echo.
-echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-echo.
-goto end
+set JAVACMD=%JAVA_HOME%\bin\java
+goto check_GSHELL_HOME
 
 :check_GSHELL_HOME
-@rem Define GSHELL_HOME if not set
 if "%GSHELL_HOME%" == "" set GSHELL_HOME=%DIRNAME%..
 
 :init
-@rem Get command-line arguments, handling Windowz variants
+rem Get command-line arguments, handling Windowz variants
 if not "%OS%" == "Windows_NT" goto win9xME_args
 if "%eval[2+2]" == "4" goto 4NT_args
 
-@rem Regular WinNT shell
-set CMD_LINE_ARGS=%*
+rem Regular WinNT shell
+set ARGS=%*
 goto execute
 
 :win9xME_args
-@rem Slurp the command line arguments.  This loop allows for an unlimited number
-set CMD_LINE_ARGS=
+rem Slurp the command line arguments.  This loop allows for an unlimited number
+set ARGS=
 
 :win9xME_args_slurp
 if "x%1" == "x" goto execute
-set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1
+set ARGS=%ARGS% %1
 shift
 goto win9xME_args_slurp
 
 :4NT_args
-@rem Get arguments from the 4NT Shell from JP Software
-set CMD_LINE_ARGS=%$
+rem Get arguments from the 4NT Shell from JP Software
+set ARGS=%$
 
 :execute
-@rem Setup the command line
-set CLASSWORLDS_CLASSPATH=%GSHELL_HOME%\lib\boot\classworlds.jar
-set CLASSWORLDS_MAIN_CLASS=org.codehaus.classworlds.Launcher
-set CLASSWORLDS_CONF=%GSHELL_HOME%\etc\%PROGNAME%.conf
-
-set JAVA_EXE=%JAVA_HOME%\bin\java.exe
-
-if "%JAVA_OPTS%" == "" set JAVA_OPTS=""
-set JAVA_OPTS=%JAVA_OPTS% -Dprogram.name="%PROGNAME%"
-set JAVA_OPTS=%JAVA_OPTS% -Dgshell.home="%GSHELL_HOME%"
-set JAVA_OPTS=%JAVA_OPTS% -Dclassworlds.conf="%CLASSWORLDS_CONF%"
-set JAVA_OPTS=%JAVA_OPTS% -Dlog4j.configuration="%PROGNAME%-log4j.properties"
-
-@rem Execute Gshell
-"%JAVA_EXE%" %JAVA_OPTS% -classpath "%CLASSWORLDS_CLASSPATH%" %CLASSWORLDS_MAIN_CLASS% %CMD_LINE_ARGS%
+rem Start the JVM
+"%JAVACMD%" %JAVA_OPTS% -jar "%GSHELL_HOME%\lib\boot\gshell-bootstrap.jar" %ARGS%
 
 :end
-@rem End local scope for the variables with windows NT shell
-if "%OS%"=="Windows_NT" endlocal
 
-@rem Optional pause the batch file
+if "%OS%"=="Windows_NT" endlocal
 if "%GSHELL_BATCH_PAUSE%" == "on" pause
 



Mime
View raw message