Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
CMD: Yii create app script
::set PATH=%PATH%;C:\wamp\bin\php\php5.3.13 ::not necessary if php is set on environment variables
::set FRAMEWORKS=C:\frameworks ::not necessary if frameworks is set on environment variables
@echo off
setlocal enabledelayedexpansion
set /a counter=0
echo Please enter your choice:
for /f %%i in ('dir /b %FRAMEWORKS%"\yii*"') do (
set /a counter+=1
set option=!counter! %%i
echo !option!
set /p M=
set /a SEL_DEC=%M%-1
if %SEL_DEC% GTR 0 (
set SKIP="skip=%SEL_DEC%"
) else (
set SKIP=
for /f %SKIP% %%e in ('dir /b %FRAMEWORKS%"\yii*"') do echo starting %%e... & set YIIV=%%e& pause & goto doit
set /p APP_NAME="Please enter Yii App name: " %=%
set YII_COM=%FRAMEWORKS%\%YIIV%\framework\yiic.php
set WWW_ROOT=C:\wamp\www
php %YII_COM% webapp %WWW_ROOT%\%APP_NAME%
goto exit
echo Operation completed!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment