Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gulp-appdmg.js - github.com/betaflight/betaflight-configurator.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f3128c79e6bbb4510886c2e5a42b7899fcde3abf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

const appdmg = require('appdmg');
const through = require('through2');
const gutil = require('gulp-util');

const PluginError = gutil.PluginError;
const PLUGIN_NAME = 'gulp-appdmg';

module.exports = function(options) {
  const stream = through.obj(function(file, encoding, next) {
    next();
  }, function(callback) {
    const self = this;
    const ee = appdmg(options);

    ee.on('progress', function(info) {
      gutil.log(`${info.current}/${info.total} ${info.type} ${info.title || info.status}`);
    });

    ee.on('error', function(err) {
      self.emit('error', new PluginError(PLUGIN_NAME, err));
      callback();
    });

    ee.on('finish', callback);
  });

  // returning the file stream
  stream.resume();
  return stream;
};