dockerode-compose
Advanced tools
Comparing version 1.2.0 to 1.2.1
const yaml = require('js-yaml'); | ||
const fs = require('fs'); | ||
const stream = require('stream'); | ||
@@ -45,2 +46,3 @@ const secrets = require('./lib/secrets'); | ||
async pull(serviceN, options) { | ||
options = options || {}; | ||
var streams = []; | ||
@@ -51,11 +53,16 @@ var serviceNames = (serviceN === undefined || serviceN === null) ? tools.sortServices(this.recipe) : [serviceN]; | ||
try { | ||
var stream = await this.docker.pull(service.image); | ||
streams.push(stream); | ||
if (options && options.verbose) { | ||
stream.pipe(process.stdout); | ||
} else { | ||
stream.pipe(new require('stream').PassThrough()); | ||
var streami = await this.docker.pull(service.image); | ||
streams.push(streami); | ||
if (options.verbose === true) { | ||
streami.pipe(process.stdout); | ||
} | ||
if (options === undefined || (options && options.streams !== true)) { | ||
await new Promise(fulfill => stream.once('end', fulfill)); | ||
if (options.streams !== true) { | ||
if (options.verbose === true) { | ||
streami.pipe(process.stdout); | ||
} else { | ||
streami.pipe(stream.PassThrough()); | ||
} | ||
await new Promise(fulfill => streami.once('end', fulfill)); | ||
} | ||
@@ -62,0 +69,0 @@ } catch (e) { |
{ | ||
"name": "dockerode-compose", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "docker-compose in nodejs using dockerode", | ||
@@ -5,0 +5,0 @@ "main": "./compose.js", |
@@ -27,2 +27,11 @@ const expect = require('chai').expect, | ||
}); | ||
it("should pull all needed images returning streams", function (done) { | ||
this.timeout(600000); | ||
(async () => { | ||
var streams = await compose.pull(null, { 'streams': true }); | ||
expect(streams).to.be.ok; | ||
done(); | ||
})(); | ||
}); | ||
}); | ||
@@ -29,0 +38,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
67367
1266
4