@ECHO off

IF NOT "x%1" == "x" GOTO :%1

:luvit
IF NOT EXIST lit.exe CALL Make.bat lit
ECHO "Building luvit"
SET LUVI_APP=app/
SET LUVI_TARGET=luvit.exe
lit\luvi-binaries\Windows\luvi.exe
SET "LUVI_APP="
SET "LUVI_TARGET="
GOTO :end

:lit
ECHO "Building lit"
git clone --recursive --depth 10 https://github.com/luvit/lit.git lit
SET LUVI_APP=lit/
SET LUVI_TARGET=lit.exe
lit\luvi-binaries\Windows\luvi.exe
SET "LUVI_APP="
SET "LUVI_TARGET="
GOTO :end

:test
IF NOT EXIST luvit.exe CALL Make.bat luvit
SET LUVI_APP=app
luvit.exe tests\run.lua
SET "LUVI_APP="
GOTO :end

:clean
IF EXIST luvit.exe DEL /F /Q luvit.exe
IF EXIST lit.exe DEL /F /Q lit.exe
IF EXIST lit RMDIR /S /Q lit
IF EXIST luvi-binaries RMDIR /S /Q luvi-binaries

:end

@ECHO off

IF NOT "x%1" == "x" GOTO :%1

:luvit
IF NOT EXIST lit.exe CALL Make.bat lit
ECHO "Building luvit"
lit.exe make
GOTO :end

:lit
ECHO "Building lit"
PowerShell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://github.com/luvit/lit/raw/0.9.8/web-install.ps1'))"
IF EXIST lit.zip DEL /F /Q lit.zip
GOTO :end

:test
IF NOT EXIST luvit.exe CALL Make.bat luvit
ECHO "Testing luvit"
SET LUVI_APP=.
luvit.exe tests\run.lua
SET "LUVI_APP="
GOTO :end

:clean
IF EXIST luvit.exe DEL /F /Q luvit.exe
IF EXIST lit.exe DEL /F /Q lit.exe

:end

Move luvit windows make to new style
Move luvit windows make to new style
