【问题标题】:gulp.dest hanging copying an electon built app (macoS)gulp.dest 挂起复制电子构建应用程序(macoS)
【发布时间】:2020-12-11 07:59:51
【问题描述】:

我正在使用 gulp 将一个 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()
    })

} )

【问题讨论】:

    标签: node.js gulp electron electron-builder gulp-dest


    【解决方案1】:

    从 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()
        })
    
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-11-01
      • 2020-01-17
      • 2011-10-26
      • 2020-11-02
      • 1970-01-01
      • 2021-09-15
      • 2021-09-19
      • 1970-01-01
      相关资源
      最近更新 更多