From 794905e7c9613b2864eded6224d8a2de92a52af6 Mon Sep 17 00:00:00 2001 From: Ignatiev Mikhail Date: Sat, 16 Jun 2018 13:11:27 +0300 Subject: [PATCH] optional params marked as [], removed string interp as it is not supported by node 6 --- index.js | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/index.js b/index.js index f7109c4..66311aa 100644 --- a/index.js +++ b/index.js @@ -38,12 +38,12 @@ const configToArgs = config => { * Executes docker-compose command with common options * @param {string} command * @param {object} options - * @param {boolean} [options.log] * @param {string} options.cwd - * @param {?(string|string[])} options.config + * @param {boolean} [options.log] + * @param {?(string|string[])} [options.config] */ const execCompose = (command, options) => new Promise((resolve, reject) => { - const cmd = `docker-compose ${configToArgs(options.config)} ${command}`; + const cmd = 'docker-compose ' + configToArgs(options.config) + ' ' + command; const cwd = options.cwd; exec(cmd, { cwd }).then( @@ -64,9 +64,9 @@ const execCompose = (command, options) => new Promise((resolve, reject) => { /** * @param {object} options - * @param {boolean} [options.log] * @param {string} options.cwd - * @param {?(string|string[])} options.config + * @param {boolean} [options.log] + * @param {?(string|string[])} [options.config] */ const up = function (options) { return execCompose('up -d', options); @@ -74,9 +74,9 @@ const up = function (options) { /** * @param {object} options - * @param {boolean} [options.log] * @param {string} options.cwd - * @param {?(string|string[])} options.config + * @param {boolean} [options.log] + * @param {?(string|string[])} [options.config] */ const down = function (options) { return execCompose('down', options); @@ -84,9 +84,9 @@ const down = function (options) { /** * @param {object} options - * @param {boolean} [options.log] * @param {string} options.cwd - * @param {?(string|string[])} options.config + * @param {boolean} [options.log] + * @param {?(string|string[])} [options.config] */ const stop = function (options) { return execCompose('stop', options); @@ -94,9 +94,9 @@ const stop = function (options) { /** * @param {object} options - * @param {boolean} [options.log] * @param {string} options.cwd - * @param {?(string|string[])} options.config + * @param {boolean} [options.log] + * @param {?(string|string[])} [options.config] */ const kill = function (options) { return execCompose('kill', options); @@ -104,9 +104,9 @@ const kill = function (options) { /** * @param {object} options - * @param {boolean} [options.log] * @param {string} options.cwd - * @param {?(string|string[])} options.config + * @param {boolean} [options.log] + * @param {?(string|string[])} [options.config] */ const rm = function (options) { return execCompose('rm -f', options);