diff --git a/index.d.ts b/index.d.ts index cb61bdb..90f6263 100644 --- a/index.d.ts +++ b/index.d.ts @@ -20,7 +20,7 @@ export declare function rm(options: IDockerComposeOptions): Promise; -export declare function logs(container: String, options: IDockerComposeLogOptions): Promise; +export declare function logs(services: String[], options: IDockerComposeLogOptions): Promise; export declare function run(service: String, command: String, options: IDockerComposeOptions): Promise; diff --git a/index.js b/index.js index da9cf17..9ec8f22 100644 --- a/index.js +++ b/index.js @@ -386,7 +386,7 @@ const restartOne = function (service, options) { }; /** - * @param {string} service + * @param {?(string|string[])} services * @param {object} options * @param {string} options.cwd * @param {boolean} [options.log] @@ -395,8 +395,8 @@ const restartOne = function (service, options) { * @param {?object} [options.env] * @param {?(string[]|Array)} [options.composeOptions] */ -const logs = function (service, options) { - let args = [ service ]; +const logs = function (services, options) { + let args = Array.isArray(services) ? services : [ services ]; if (options.follow) { args = [ '--follow', ...args ]; diff --git a/readme.md b/readme.md index cd781b4..9d085f0 100644 --- a/readme.md +++ b/readme.md @@ -28,7 +28,7 @@ npm install --save-dev docker-compose * `stop(options)` - Stop running containers without removing them * `rm(options)` - Remove stopped service containers - always uses the `-f` flag due to non interactive mode * `exec(container, command, options)` - Exec `command` inside `container`, uses `-T` to properly handle stdin & stdout -* `logs(container, command, options)` - Show logs of service. Use `options.follow` `true|false` to turn on `--follow` flag. +* `logs(services, options)` - Show logs of service(s). Use `options.follow` `true|false` to turn on `--follow` flag. * `run(service, command, options)` - Run a one-off `command` on a service, uses `-T` to properly handle stdin & stdout * `buildAll(options)` - Build or rebuild services * `buildMany(services, options)` - Build or rebuild services