gull.dest挂起复制一个electon构建的应用程序(macoS)



我正在使用gump将Electron构建的应用程序复制到一个目录中,而任务似乎挂在了复制的中间。检查dest目录—副本仅部分完成;有些文件已经复制,有些还没有。如果我删除LUafiles中的.app行,所有Lua文件都会复制,任务就会完成。

我的最佳猜测是.app目录结构中的符号链接可能会给它带来麻烦,但我不能确定。符号链接指向.ap目录中的文件。思想受到赞赏。

const gulp = require('gulp');
const debug = require('gulp-debug')
const Lualib = '/Users/kimaldis/Documents/Dev/lightroom dev/lib'
var Luafiles = [
"Tak.lrdevplugin/**/*.lua",
Lualib + "/JSON.lua",
Lualib + "/Path.lua",
Lualib + "/Utils.lua",
Lualib + "/Log.lua",
Lualib + "/class.lua",
"TakServer/dist/mac/takserver-darwin-x64/*takserver.app/**/*"   // run npm run package-mac in root first to build server app
]
gulp.task('watch', function() {
console.log( `watching ${Luafiles}` )
// copy lr plugin to local plugin dir
// copy takserver app into '<install dir>/Tak.lrdevplugin'
gulp.watch( Luafiles, function ( cb ) {
gulp.src( Luafiles, { } )
.pipe(gulp.dest( `/Users/kimaldis/Lightroom/Lightroom Plugins/Tak.lrdevplugin` ))
.pipe(debug({title: 'Copying LR Plugin to local plugin dir :'}))
.on('error', () => {
console.error('Error');
})
.on('finish', () => { 
console.log('Success');
});

return cb()
})
} )

从gulp.src((返回返回值修复了挂起。将{follow:true}添加到gulp.src((中可以正确复制符号链接。符号链接已解决,不再是目标树中的符号链接,但这似乎没有问题:

gulp.watch( Luafiles, function ( cb ) {
return gulp.src( Luafiles, { follow: true }  )
.pipe(gulp.dest( `/Users/kimaldis/Lightroom/Lightroom Plugins/Tak.lrdevplugin` ))
.pipe(debug({title: 'Copying LR Plugin to local plugin dir :'}))
.on('error', () => {
console.error('Error');
})
.on('finish', () => { 
console.log('Success');
});

// return cb()
})

最新更新