【发布时间】:2014-09-05 15:03:04
【问题描述】:
我想将一个不需要编译或不需要保存到新位置的已保存文件传递给 gulp-tap,以便我可以在其上运行外部脚本。
现在我看的是一个完整的目录,每次保存时我都会上传整个目录:
gulp.task('shopify_theme',function(){
gulp.src( './theme/**/*.liquid' )
.pipe(tap(function(file){
upload(file);
}));
})
这是上传部分(主题是一个将资产上传到shopify的应用程序)
var upload = function( file ){
var splitPath = file.path.split('theme/').pop();
run('theme upload ' + splitPath, { cwd: 'theme' }).exec();
};
每次我在 /theme 目录中保存一个液体文件时,所有文件 (theme/**/*.liquid) 都会被上传。 gulp-changed 不起作用,因为在任务运行时目标和源是相同的。
仅上传已更改文件的最佳方式是什么?
【问题讨论】:
标签: gulp gulp-watch