forked from emuflight/EmuConfigurator
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulp-macdmg.js
More file actions
30 lines (24 loc) · 741 Bytes
/
gulp-macdmg.js
File metadata and controls
30 lines (24 loc) · 741 Bytes
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
var appdmg = require('appdmg');
var through = require('through2');
var PluginError = require('plugin-error');
var log = require('fancy-log');
var PLUGIN_NAME = 'gulp-macdmg';
module.exports = function(options) {
var stream = through.obj(function(file, encoding, next) {
next();
}, function(callback) {
var self = this;
var ee = appdmg(options);
ee.on('progress', function(info) {
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;
};