forked from mdreizin/chrome-bookmarks-alfred-workflow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
45 lines (35 loc) · 1.12 KB
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
'use strict';
var path = require('path'),
del = require('del'),
gulp = require('gulp'),
foreach = require('gulp-foreach'),
zip = require('gulp-zip'),
runSequence = require('run-sequence'),
Gitdown = require('gitdown');
var src = './src',
dist = './dist';
gulp.task('clean', function(callback) {
del(path.join(dist, '**'), callback);
});
gulp.task('dist', function() {
return gulp.src(path.join(src, '*'))
.pipe(foreach(function(stream, file) {
var basename = path.basename(file.path);
return gulp.src(path.join(file.path, '**'))
.pipe(zip(basename + '.alfredworkflow'))
.pipe(gulp.dest(dist));
}));
});
gulp.task('gitdown:readme', function() {
return Gitdown.read('.gitdown/README.md').write('README.md');
});
gulp.task('gitdown', function(callback) {
runSequence('gitdown:readme', callback);
});
gulp.task('docs', ['gitdown']);
gulp.task('build', [], function(callback) {
runSequence('clean', 'docs', 'dist', callback);
});
gulp.task('default', function(callback) {
runSequence('build', callback);
});