forked from mozilla/webmaker-android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexport.js
32 lines (29 loc) · 899 Bytes
/
export.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
// For exporting publish assets via npm
var gulp = require('gulp');
var path = require('path');
var buildDir = __dirname + '/build/';
function handleError(stream, cb) {
stream.on('end', function() {
cb(null);
});
stream.on('error', function (err) {
cb(err);
});
}
module.exports = {
copySharedAssets: function (dest, cb) {
var dirs = ['content/**/*', 'fonts/**/*', 'images/**/*', 'styles/**/*.css']
var s = gulp.src(dirs.map(function (dir) {
return buildDir + dir;
}), {base: buildDir}).pipe(gulp.dest(dest));
handleError(s, cb);
},
copyPublishAssets: function (dest, cb) {
var s = gulp.src([
buildDir + 'publish-assets/**/*',
// Exclude sample app.js
'!' + buildDir + 'publish-assets/app.js'
]).pipe(gulp.dest(dest));
handleError(s, cb);
}
};