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

github.com/betaflight/betaflight-configurator.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Chmelevskij <t.chmelevskij@gmail.com>2021-12-17 20:38:53 +0300
committerTomas Chmelevskij <t.chmelevskij@gmail.com>2021-12-17 20:38:53 +0300
commit8e508d9723e38c7070e075bc0f74a4e0e05ee786 (patch)
tree255a59548748c70fdad08b81552b6fee3b03bc4a /gulp-appdmg.js
parentae2ef20ce20aab23f104dd28a896dbcadb33778f (diff)
chore(repo): update node version to 14
Diffstat (limited to 'gulp-appdmg.js')
-rw-r--r--gulp-appdmg.js31
1 files changed, 31 insertions, 0 deletions
diff --git a/gulp-appdmg.js b/gulp-appdmg.js
new file mode 100644
index 00000000..def0222e
--- /dev/null
+++ b/gulp-appdmg.js
@@ -0,0 +1,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;
+};