Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.

Commit

Permalink
Merge branch 'dev' of https://github.com/marklogic/roxy into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
dmcassel committed Mar 18, 2013
2 parents dc43a90 + 95bfe7a commit de7478a
Showing 1 changed file with 42 additions and 2 deletions.
44 changes: 42 additions & 2 deletions ml.bat
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ for %%e in (%PATHEXT%) do (
)
if not defined RUBYFOUND goto needruby

if "%1"=="self-test" goto selftest

IF not "%1"=="new" goto rubydeployer
SHIFT
IF "%1"=="" goto usage
Expand All @@ -29,14 +31,47 @@ if not defined GITFOUND goto needgit

IF EXIST %app_name% GOTO alreadyexists

set BRANCH=master
set INIT_GIT=0
set APPTYPE=mvc

:loop
if not "%1"=="" (
if "%1"=="--branch" (
set BRANCH=%2
shift
)
if "%1"=="--app-type" (
set APPTYPE=%2
shift
)
shift
goto :loop
)

if not "%APPTYPE%"=="mvc" if not "%APPTYPE%"=="rest" if not "%APPTYPE%"=="hybrid" (
echo Valid values for app-type are mvc, rest and hybrid. Aborting.
exit /b
)

echo.
echo Creating new Application: %app_name%...

cmd /c git clone git://github.com/marklogic/roxy.git %app_name%
cmd /c git clone git://github.com/marklogic/roxy.git -b %BRANCH% %app_name%
pushd %app_name%
rmdir /Q /S .git
del /F /Q .gitignore
cmd /c ml init %app_name%

if "%APPTYPE%"=="rest" (
REM For a REST application, we won't be using the MVC code. Remove it.
REM mvc and hybrid apps will use it.
rmdir /S /Q src
mkdir src
echo.
echo No initial source code is provided for REST apps. You can copy code from Application Builder under the source directory.
)

cmd /c ml init %app_name% --app-type=%APPTYPE%
popd
echo done
echo.
Expand All @@ -60,6 +95,11 @@ popd

goto end

:selftest
if NOT EXIST deploy\test\test_main.rb GOTO missingdeploy
ruby -Ideploy -Ideploy\lib -Ideploy\test deploy\test\test_main.rb
goto end

:rubydeployer
if NOT EXIST deploy\lib\ml.rb GOTO missingdeploy
ruby -Ideploy -Ideploy\lib deploy\lib\ml.rb %*
Expand Down

0 comments on commit de7478a

Please sign in to comment.