daily pastebin goal
9%
SHARE
TWEET

Untitled

a guest May 7th, 2016 83 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var gulp = require('gulp'),
  2.     watch = require('gulp-watch'),
  3.     gutil = require( 'gulp-util' ),
  4.     sass = require('gulp-sass'),
  5.     notify = require("gulp-notify"),
  6.     ftp = require( 'vinyl-ftp' );
  7.  
  8. gulp.task( 'deploy', ['css'], function () {
  9.  
  10.  
  11.     var conn = ftp.create( {
  12.         host:     'myhost',
  13.         user:     'user@host',
  14.         password: '****',
  15.         parallel: 10,
  16.         log:      gutil.log
  17.     } );
  18.  
  19.     var globs = [
  20.         'src/**',
  21.         'css/**',
  22.         'build/**',
  23.         'js/**',
  24.         'fonts/**',
  25.         'index.html'
  26.     ];
  27.  
  28.  
  29.     // using base = '.' will transfer everything to /public_html correctly
  30.     // turn off buffering in gulp.src for best performance
  31.  
  32.     return gulp.src( globs, { base: '.', buffer: false } )
  33.         .pipe( conn.newer( '/test' ) ) // only upload newer files
  34.         .pipe( conn.dest( '/test' ) )
  35.         .pipe(notify("Files have been send"))
  36.         ;
  37.  
  38. } );
  39.  
  40. gulp.task('css', function () {
  41.     return gulp.src('scss/**/*.scss')
  42.         .pipe(sass().on('error', sass.logError))
  43.         .pipe(gulp.dest('css'))
  44. });
  45.  
  46. gulp.task('watch', function (){
  47.   gulp.watch('scss/**/*.scss', ['css', 'deploy']);
  48. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top