return promise for rm function

This commit is contained in:
Alexander Zeitler 2017-08-24 16:54:07 +02:00
parent 04a53032dc
commit cb9da9ef14
2 changed files with 17 additions and 11 deletions

View file

@ -128,18 +128,24 @@ const kill = function (options) {
* @param {cwd} options.cwd * @param {cwd} options.cwd
*/ */
const rm = function (options) { const rm = function (options) {
return new Promise((resolve, reject) => {
const cwd = options.cwd; const cwd = options.cwd;
exec('docker-compose rm', { cwd }).then( exec('docker-compose rm', { cwd }).then(
standards => { standards => {
if (options.log) { if (options.log) {
logStandards(standards); logStandards(standards);
return resolve();
} }
}, },
err => { err => {
logger.error(err.message); logger.error(err.message);
return reject(err);
} }
); );
});
}; };
module.exports = { up, kill, down, stop, rm }; module.exports = { up, kill, down, stop, rm };

View file

@ -1,6 +1,6 @@
{ {
"name": "docker-compose", "name": "docker-compose",
"version": "0.3.1", "version": "0.3.2",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"test": "./node_modules/tape/bin/tape test", "test": "./node_modules/tape/bin/tape test",