joaomoreno/gulp-atom-electron

Piping gulp-atom-shell output into directory using gulp.dest (instead of into a zip using zfsdest) produces a corrupted build

nullstyle opened this issue · 5 comments

Given the stream:

  return gulp.src([
    `.tmp/built/${cli.app}/**/*`,
    `support/atom/**/*`,
    ])
    .pipe($.atomShell({
      version: '0.20.4',
      productName: cli.app,
      productVersion: '0.0.1',
      platform: 'darwin'
    }))
    .pipe(gulp.dest(`./dist/atom/${cli.app}`))
    .pipe($.atomShell.zfsdest(`./${cli.app}.zip`))
    ;

You'll end up with a zipped archive and an unzipped .app file. If you unzip the archive, and then open the .app that was unpacked, everything works fine. If you try to open the .app that was never zipped, you get a crash on launch with the following message:

problem_report_for_hello-world

Unfortunately, you've hit the problem that gave birth to zfsdest.

On OS X, the Atom.app bundle contains symlinks, which vinyl-fs doesn't fully understand yet, and thus gulp.dest fails to correctly create in place. So, if you use gulp.dest to create the OS X application, it will not load. zfsdest is the only way to go now.

It would be possible to provide a custom dest function that understands the custom symlink vinyl objects and creates them correctly. I'll use this issue for that.

Good to know, regarding the symlinks. For now, I can easily enough append a step onto the build process that unzips the built archive (The goal is to have a tasks that builds the app and opens it for the developer in one command).

Thanks for the update, and for the project!

+1 I would like to write my files out to a directory instead of a zip file. I like this plugin, good work!

+1,i'l write a shell script to unzips the built archive and open it. ,

This works:

var gulp = require('gulp');
var electron = require('gulp-atom-electron');

gulp.task('default', function () {
    return gulp.src('src/**')
        .pipe(electron({ version: '0.19.4', platform: 'darwin' }))
        .pipe(electron.dest('app'));
});

Note the electron.dest(...), instead of gulp.dest(...).