Skip to content

Instantly share code, notes, and snippets.

@VivienLN
Created December 3, 2015 09:16
Show Gist options
  • Select an option

  • Save VivienLN/dcf73e218f73446e8446 to your computer and use it in GitHub Desktop.

Select an option

Save VivienLN/dcf73e218f73446e8446 to your computer and use it in GitHub Desktop.
Batch file to init npm/gulp/sass project in a given directory
echo off
REM ---------------------------------------
REM settings
REM TODO: add gulpfile.js
REM ---------------------------------------
set pdrive=C:
set pdir=/wamp/www/
set gulp_dep=gulp-jshint gulp-sass gulp-imagemin gulp-autoprefixer gulp-minify-css gulp-uglify
REM ---------------------------------------
%pdrive%
cd %pdir%
echo ------------------------------------------------------
echo Create project directory in %pdir%
echo ------------------------------------------------------
set /p dir="Directory name:"
if not exist "%dir%" (
mkdir "%dir%"
echo Directory created: %dir%
)
echo Moving to %pdir%%dir%
cd %dir%
echo ------------------------------------------------------
echo Initialize NPM Project
echo ------------------------------------------------------
pause
call npm init
echo ------------------------------------------------------
echo Install gulp and modules
echo ------------------------------------------------------
pause
call npm install gulp
call npm install gulp-sass --save-dev
call npm install gulp-minify-css --save-dev
call npm install gulp-autoprefixer --save-dev
call npm install gulp-concat --save-dev
call npm install gulp-jshint --save-dev
call npm install gulp-imagemin --save-dev
call npm install gulp-uglify --save-dev
echo ------------------------------------------------------
echo Install Bootstrap
echo ------------------------------------------------------
set /p yn="Install bootstrap (y/n)?"
if %yn% (
call npm install bootstrap-sass --save
)
echo Finished!
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment