Last active
August 29, 2015 14:20
-
-
Save iampeterbanjo/ebd1d804bcade581fe43 to your computer and use it in GitHub Desktop.
Email testing with gulp-litmus and friends
This file contains hidden or 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
var gulp = require('gulp') | |
, litmus = require('gulp-litmus') | |
, gutil = require('gulp-util') | |
, ftp = require('gulp-ftp') | |
, inlineCss = require('gulp-inline-css') | |
, replace = require('gulp-replace') | |
, runSequence = require('run-sequence') | |
, config = require('./config.json') | |
; | |
gulp.task('images', function () { | |
return gulp.src('images/*') | |
.pipe(ftp(config.ftp)) | |
.pipe(gutil.noop()); | |
}); | |
gulp.task('litmus', function () { | |
return gulp.src('dist/index.html') | |
.pipe(litmus(config.litmus)) | |
.pipe(gulp.dest('dist')); | |
}) | |
gulp.task('html', function () { | |
return gulp.src('index.html') | |
.pipe(inlineCss()) | |
.pipe(replace('src="images/', 'src="http://that.website.com/' + config.ftp.remotePath.split('/public_html/')[1] + '/')) | |
.pipe(gulp.dest('dist')); | |
}); | |
gulp.task('test', function () { | |
runSequence('images', 'html', 'litmus'); | |
}); | |
gulp.task('default', ['test']); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment