From 11f4eed118987a7015b82f18ae0d6b02e7e2b28e Mon Sep 17 00:00:00 2001 From: "J. King" Date: Fri, 8 Dec 2017 15:15:20 -0500 Subject: [PATCH] Scripts for Robo --- robo | 6 ++++++ robo.bat | 17 +++++++++++++++++ tests/test | 8 -------- tests/test.bat | 11 ----------- 4 files changed, 23 insertions(+), 19 deletions(-) create mode 100755 robo create mode 100644 robo.bat delete mode 100755 tests/test delete mode 100644 tests/test.bat diff --git a/robo b/robo new file mode 100755 index 00000000..ab928f77 --- /dev/null +++ b/robo @@ -0,0 +1,6 @@ +#! /bin/sh +base=`dirname "$0"` +roboCommand="$1" + +shift +"$base/vendor/bin/robo" "$roboCommand" -- $* \ No newline at end of file diff --git a/robo.bat b/robo.bat new file mode 100644 index 00000000..f0c1de40 --- /dev/null +++ b/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% \ No newline at end of file diff --git a/tests/test b/tests/test deleted file mode 100755 index fcc01aea..00000000 --- a/tests/test +++ /dev/null @@ -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 \ No newline at end of file diff --git a/tests/test.bat b/tests/test.bat deleted file mode 100644 index 5d22caf8..00000000 --- a/tests/test.bat +++ /dev/null @@ -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 -) \ No newline at end of file