mirror of
https://github.com/wagtail/wagtail.git
synced 2024-11-30 01:46:24 +01:00
6f18c5ea0f
Normalize all paths to have only forward slashes before mangling them.
37 lines
993 B
JavaScript
37 lines
993 B
JavaScript
var gulp = require('gulp');
|
|
var rename = require('gulp-rename');
|
|
var gutil = require('gulp-util');
|
|
var path = require('path');
|
|
var config = require('../config');
|
|
var normalizePath = require('../lib/normalize-path');
|
|
|
|
/*
|
|
* Simple copy task - just copoes files from the source to the destination,
|
|
* with no compilation, minification, or other intelligence
|
|
*
|
|
*/
|
|
|
|
var renameSrcToDest = function() {
|
|
return rename(function(filePath) {
|
|
filePath.dirname = normalizePath(filePath.dirname).replace(
|
|
'/' + config.srcDir + '/',
|
|
'/' + config.destDir + '/');
|
|
});
|
|
};
|
|
|
|
|
|
var simpleCopyTask = function(glob) {
|
|
return function() {
|
|
var sources = config.apps.map(function(app) {
|
|
return path.join(app.sourceFiles, app.appName, glob);
|
|
});
|
|
|
|
return gulp.src(sources, {base: '.'})
|
|
.pipe(renameSrcToDest())
|
|
.pipe(gulp.dest('.'))
|
|
.on('error', gutil.log);
|
|
};
|
|
};
|
|
|
|
module.exports = simpleCopyTask;
|