-
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
97d72a1
commit c2892e2
Showing
5 changed files
with
69 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
const alias = require('macos-alias'); | ||
|
||
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; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.