salix/dev.cmd

30 lines
836 B
Batchfile

@echo off
set currentDir=%cd%
set nginxPrefix=%currentDir%\services\nginx
set nginxConf=%nginxPrefix%\conf-dev.conf
if "%1"=="" goto caseStart
if "%1"=="start" goto caseStart
if "%1"=="stop" goto caseStop
goto caseUsage
:caseStart
call "%0" stop
echo "################################ Starting services"
if not exist "%nginxPrefix%\temp" (mkdir "%nginxPrefix%\temp")
start /I nginx -c "%nginxConf%" -p "%nginxPrefix%"
call forever --minUptime 1000 --spinSleepTime 1000 start forever.json
gulp --gulpfile @salix\gulpfile.js
goto caseExit
:caseStop
echo "################################ Stoping services"
if exist "%nginxPrefix%\temp\nginx.pid" (nginx -c "%nginxConf%" -p "%nginxPrefix%" -s stop)
forever stopall
goto caseExit
:caseUsage
echo "Usage: %0 [start|stop]"
:caseExit