Skip to content

Commit

Permalink
Debug #538
Browse files Browse the repository at this point in the history
  • Loading branch information
apocas committed Feb 5, 2020
1 parent ff63462 commit bd5fd18
Showing 1 changed file with 2 additions and 21 deletions.
23 changes: 2 additions & 21 deletions lib/docker.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ Docker.prototype.checkAuth = function(opts, callback) {
Docker.prototype.buildImage = function(file, opts, callback) {
var self = this;
var content;
var pack;
var pack = tar.pack();

if (!callback && typeof opts === 'function') {
callback = opts;
Expand Down Expand Up @@ -304,26 +304,7 @@ Docker.prototype.buildImage = function(file, opts, callback) {
pack = tar.pack(file.context, {
entries: file.src
});

if (callback === undefined) {
return new self.modem.Promise(function(resolve, reject) {
pack.on('error', function(error) {
return reject(error);
});
pack.on('end', function() {
return resolve(build(stream));
});
var stream = pack.pipe(zlib.createGzip());
});
} else {
pack.on('error', function(error) {
return callback(error);
});
pack.on('end', function() {
return build(stream);
});
var stream = pack.pipe(zlib.createGzip());
}
return build(pack.pipe(zlib.createGzip()));
} else {
return build(file);
}
Expand Down

0 comments on commit bd5fd18

Please sign in to comment.