Created
March 25, 2015 14:28
-
-
Save dalibormesaric/3d9fcab61abc5527a491 to your computer and use it in GitHub Desktop.
Check for git, node, bower and install packages - CLI beginner friendly
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
:: Check if git is installed | |
@ECHO Looking for git ... | |
call git --version >nul 2>nul | |
IF ERRORLEVEL 1 ( | |
@ECHO Please install git from http://git-scm.com/downloads | |
goto :end_batch | |
) | |
call git --version | |
:: Check for node.js | |
@ECHO Looking for node.js ... | |
call npm -v >nul 2>nul | |
IF ERRORLEVEL 1 ( | |
@ECHO Please install node from https://nodejs.org/ | |
goto :end_batch | |
) | |
@<nul set /p = node.js version | |
call node -v | |
@<nul set /p = npm version | |
call npm -v | |
:: Check if bower is installed | |
@ECHO Looking for bower ... | |
call bower -v >nul 2>nul | |
IF ERRORLEVEL 1 ( | |
@ECHO Please install bower from http://bower.io/ | |
goto :end_batch | |
) | |
@<nul set /p = bower version | |
call bower -v | |
goto :choice | |
:choice | |
set /P c=Would you like to run "npm install --save-dev" and "bower install --save" [Y/N] ? | |
if /I "%c%" EQU "Y" goto :install | |
if /I "%c%" EQU "N" goto :end_batch | |
:install | |
call npm install --save-dev | |
call bower install --save | |
:end_batch |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment