Browse Source

Scripts for Robo

microsub
J. King 6 years ago
parent
commit
11f4eed118
  1. 6
      robo
  2. 17
      robo.bat
  3. 8
      tests/test
  4. 11
      tests/test.bat

6
robo

@ -0,0 +1,6 @@
#! /bin/sh
base=`dirname "$0"`
roboCommand="$1"
shift
"$base/vendor/bin/robo" "$roboCommand" -- $*

17
robo.bat

@ -0,0 +1,17 @@
@echo off
setlocal
set base=%~dp0
set roboCommand=%1
rem get all arguments except the first
shift
set "args="
:parse
if "%~1" neq "" (
set args=%args% %1
shift
goto :parse
)
if defined args set args=%args:~1%
call "%base%vendor\bin\robo" "%roboCommand%" -- %args%

8
tests/test

@ -1,8 +0,0 @@
#! /bin/sh
base=`dirname "$0"`
php -n -S localhost:8000 "$base/server.php" >/dev/null 2>/dev/null &
sleep 1s
"$base/../vendor/bin/phpunit" -c "$base/phpunit.xml" $*
sleep 1s
pid=`lsof -n -i:8000 | grep -Eo "php\s+[0-9]+" | grep -Eo "[0-9]+"`
kill $pid

11
tests/test.bat

@ -1,11 +0,0 @@
@echo off
setlocal
set base=%~dp0
start /b php -n -S localhost:8000 "%base%server.php" >nul 2>nul
timeout /nobreak /t 1 >nul
call "%base%..\vendor\bin\phpunit" -c "%base%phpunit.xml" %*
timeout /nobreak /t 1 >nul
for /f "usebackq tokens=5" %%a in (`netstat -aon ^| find "LISTENING" ^| find ":8000"`) do (
taskkill /f /pid %%a >nul
goto :eof
)
Loading…
Cancel
Save