Sha256: cb727fc5e38bbdb4440422987f715cff32d10416c38da5714902bac4c761760c

Contents?: true

Size: 1.8 KB

Versions: 19

Compression:

Stored size: 1.8 KB

Contents

@echo off

setlocal

REM Set intermediate env vars because the %VAR:x=y% notation below
REM (which replaces the string x with the string y in VAR)
REM doesn't handle undefined environment variables. This way
REM we're always dealing with defined variables in those tests.
set CHK_JAVA_HOME=_%JAVA_HOME%
set CHK_SERVICE_HOME=_%SERVICE_HOME%
set CHK_CREDENTIAL_FILE=_%AWS_CREDENTIAL_FILE%

if "%CHK_CREDENTIAL_FILE:"=%" == "_" goto CREDENTIAL_FILE_MISSING
SET AWS_CREDENTIAL_FILE=%AWS_CREDENTIAL_FILE:"=%
:CREDENTIAL_FILE_MISSING

if "%CHK_SERVICE_HOME:"=%" == "_" goto SERVICE_HOME_MISSING
if "%CHK_JAVA_HOME:"=%" == "_" goto JAVA_HOME_MISSING

REM If a classpath exists preserve it

SET SERVICE_HOME=%SERVICE_HOME:"=%
SET LIB="%SERVICE_HOME%\lib"

REM Brute force
SETLOCAL ENABLEDELAYEDEXPANSION

SET CP=%LIB%\service.jar
for /F "usebackq" %%c in (`dir /b %LIB%`) do SET CP=!CP!;%LIB%\%%c

REM Grab the class name
SET CMD=%1

REM SHIFT doesn't affect %* so we need this clunky hack
SET ARGV=%2
SHIFT
SHIFT
:ARGV_LOOP
IF (%1) == () GOTO ARGV_DONE
REM Get around strange quoting bug
SET ARG=%1

REM Escape the minus sign for negative numbers
ECHO %ARG% > %TEMP%\argtest
FINDSTR /B \-[0-9.] %TEMP%\argtest > NUL
if %ERRORLEVEL%==0 (
    SET ARG=\%ARG%
)
DEL %TEMP%\argtest


SET ARG=%ARG:"=%
SET ARGV=%ARGV% "%ARG%"
SHIFT
GOTO ARGV_LOOP
:ARGV_DONE

REM Make sure JAVA_HOME has only a single sorrounding double quotes
set JAVA_HOME="%JAVA_HOME:"=%"

REM run
%JAVA_HOME%\bin\java %SERVICE_JVM_ARGS% -classpath %CP% com.amazon.webservices.Cli %CMD% %ARGV%
goto DONE

:JAVA_HOME_MISSING
echo JAVA_HOME is not set
exit /b 1

:SERVICE_HOME_MISSING
echo "This command is not intended to be run directly. Please see documentation on using service commands."
exit /b 1

:DONE
endlocal

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
cloudformation-ruby-dsl-0.5.4 vendor/AWSCloudFormation-1.0.12/bin/service.cmd
cloudformation-ruby-dsl-0.5.3 vendor/AWSCloudFormation-1.0.12/bin/service.cmd
cloudformation-ruby-dsl-0.5.2 vendor/AWSCloudFormation-1.0.12/bin/service.cmd
cloudformation-ruby-dsl-0.5.1 vendor/AWSCloudFormation-1.0.12/bin/service.cmd
cloudformation-ruby-dsl-0.5.0 vendor/AWSCloudFormation-1.0.12/bin/service.cmd
cloudformation-ruby-dsl-0.4.14 vendor/AWSCloudFormation-1.0.12/bin/service.cmd
cloudformation-ruby-dsl-0.4.13 vendor/AWSCloudFormation-1.0.12/bin/service.cmd
cloudformation-ruby-dsl-0.4.12 vendor/AWSCloudFormation-1.0.12/bin/service.cmd
cloudformation-ruby-dsl-0.4.11 vendor/AWSCloudFormation-1.0.12/bin/service.cmd
cloudformation-ruby-dsl-0.4.10 vendor/AWSCloudFormation-1.0.12/bin/service.cmd
cloudformation-ruby-dsl-0.4.9 vendor/AWSCloudFormation-1.0.12/bin/service.cmd
cloudformation-ruby-dsl-0.4.8 vendor/AWSCloudFormation-1.0.12/bin/service.cmd
cloudformation-ruby-dsl-0.4.7 vendor/AWSCloudFormation-1.0.12/bin/service.cmd
cloudformation-ruby-dsl-0.4.6 vendor/AWSCloudFormation-1.0.12/bin/service.cmd
cloudformation-ruby-dsl-0.4.5 vendor/AWSCloudFormation-1.0.12/bin/service.cmd
cloudformation-ruby-dsl-0.4.4 vendor/AWSCloudFormation-1.0.12/bin/service.cmd
cloudformation-ruby-dsl-0.4.3 vendor/AWSCloudFormation-1.0.12/bin/service.cmd
cloudformation-ruby-dsl-0.4.2 vendor/AWSCloudFormation-1.0.12/bin/service.cmd
cloudformation-ruby-dsl-0.4.1 vendor/AWSCloudFormation-1.0.12/bin/service.cmd