М

Size: a a a
М

🇺L
'use strict';
console.time('Loading plugins');
var gulp = require('gulp'),
watch = require('gulp-watch'),
shell = require('gulp-shell'),
tap = require('gulp-tap'),
livereload = require('gulp-livereload');
console.timeEnd('Loading plugins');
var path = {
watch: {
modx: '_data/**/*.*'
},
modx: {
root: '.',
data: '_data/'
}
};
function modxTaskCreator(type) {
gulp.task('modx:build:' + type, function () {
gulp.src(path.modx.data + type)
.pipe(shell([
//'gitify build ' + type + ' --skip-clear-cache'
'gitify build ' + type
], {cwd: path.modx.root}));
});
}
gulp.task('modx:init', function() {
gulp.src(path.modx.data + '*')
.pipe(tap(function (file, t) {
modxTaskCreator(file.path.split('/').pop());
}));
});
gulp.start('modx:init');
gulp.task('modx:build', function() {
gulp.src(path.modx.data + '*')
.pipe(tap(function (file, t) {
gulp.start('modx:build:' + file.path.split('/').pop());
}));
});
gulp.task('watch', function(){
watch([path.watch.modx], function(event, cb) {
var path = event.path.split('/');
var type = path[path.length - 2];
gulp.start('modx:build:' + type);
});
});
gulp.task('default', ['modx:build', 'watch']);
S

РН
S
РН
S
М
РН
М
S
S
М
NK
М
РН
ПК
ПК
М
NK