Batch to Angular Component Library
Batch files for Angular Component creation
@echo off
echo "Welcome to Angular Lip App"
REM Changing Path
cd\xampp\htdocs\
cd
REM Checking Version
echo "///////////////////////////////////////////////////////////////////////////"
echo "Your NPM version"
call npm -v
echo "Your CLI version"
call ng -v
REM Get Project name from User
echo "///////////////////////////////////////////////////////////////////////////"
:GETLIPNAME
set /p inputone=Enter Lib Name it will become(*-ra-lib-app):
set temp1=-ra-lib-app
set temp2=-ra-lib
set projectName=%inputone%%temp1%
set libname= %inputone%%temp2%
IF EXIST %projectName% (
echo "Folder Already exists plz enter new one......"
GOTO GETLIPNAME
) ELSE (
echo "//////////////////////////////////////////////////////////////////////////////"
echo "App starting on this folder: %libname%"
echo "//////////////////////////////////////////////////////////////////////////////"
call ng new %projectName%
RENAME %projectName% %libname%
cd\%libname%
call ng generate library %libname% --prefix=enl
call ng build %libname%
call code .
call start .
call ng server --public-host http://localhost:4200/
cd
)
pause
echo "Welcome to Angular Lip App"
REM Changing Path
cd\xampp\htdocs\
cd
REM Checking Version
echo "///////////////////////////////////////////////////////////////////////////"
echo "Your NPM version"
call npm -v
echo "Your CLI version"
call ng -v
REM Get Project name from User
echo "///////////////////////////////////////////////////////////////////////////"
:GETLIPNAME
set /p inputone=Enter Lib Name it will become(*-ra-lib-app):
set temp1=-ra-lib-app
set temp2=-ra-lib
set projectName=%inputone%%temp1%
set libname= %inputone%%temp2%
IF EXIST %projectName% (
echo "Folder Already exists plz enter new one......"
GOTO GETLIPNAME
) ELSE (
echo "//////////////////////////////////////////////////////////////////////////////"
echo "App starting on this folder: %libname%"
echo "//////////////////////////////////////////////////////////////////////////////"
call ng new %projectName%
RENAME %projectName% %libname%
cd\%libname%
call ng generate library %libname% --prefix=enl
call ng build %libname%
call code .
call start .
call ng server --public-host http://localhost:4200/
cd
)
pause
Comments
Post a Comment