借助gulp,我正在执行以下任务序列:
gulp.js
gulp.task( 'build', function(callback) {
runSequence( 'build-clean', 'copy-main', 'edit-main', 'zip-plugin' );
});
在主编辑任务中,我使用rimraf删除了输入
...
var translations_build_path = build_path + main_config.plugin_dir + "/translations/";
let src_po_path = translations_build_path + main_config.plugin_dir + "-fr_FR.po" ;
let dest_po_path = translations_build_path + main_config.plugin_dir + "-" + options.env + "-fr_FR.po" ;
gulp.src( src_po_path, {base: translations_build_path } )
.pipe(rimraf())
.pipe(rename( dest_po_path ) )
.pipe(gulp.dest('.'));
/*mo*/
let src_mo_path = translations_build_path + main_config.plugin_dir + "-fr_FR.mo" ;
let dest_mo_path = translations_build_path + main_config.plugin_dir + "-" + options.env + "-fr_FR.mo" ;
gulp.src( src_mo_path, {base: translations_build_path } )
.pipe(rimraf())
.pipe(rename( dest_mo_path ) )
.pipe(gulp.dest('.'));
...
当我尝试像这样压缩文件夹时:
gulp.task( 'zip-plugin', function( ){
if( options.env === "dev" ){
const build_main_plugin_path = build_path + plugin_ini.main.plugin_dir;
return gulp.src( build_main_plugin_path + "/**/*", {base: build_path } )
.pipe( zip(plugin_ini.main.plugin_dir +'.zip'))
.pipe(gulp.dest( build_main_plugin_path ) );
}
});
我收到此错误:
events.js:183 投掷者//未处理的“错误”事件 ^ 错误:ENOENT:没有这样的文件或目录,lstat'我的文件夹的路径\ translations \ my-plugin-fr_FR.mo'
是的,我将my-plugin-fr_FR.mo
重命名后将其压缩为整个文件夹。
我该如何解决?