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
*/
const rm = function (options) {
const cwd = options.cwd;
return new Promise((resolve, reject) => {
const cwd = options.cwd;
exec('docker-compose rm', { cwd }).then(
standards => {
if (options.log) {
logStandards(standards);
exec('docker-compose rm', { cwd }).then(
standards => {
if (options.log) {
logStandards(standards);
return resolve();
}
},
err => {
logger.error(err.message);
return reject(err);
}
},
err => {
logger.error(err.message);
}
);
);
});
};
module.exports = { up, kill, down, stop, rm };

View file

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