From 29f5c9b7e04206c24ec18d593a80618098e9e3d4 Mon Sep 17 00:00:00 2001 From: Petros Angelatos Date: Wed, 11 Jun 2014 01:51:54 +0100 Subject: [PATCH] Use promise API --- src/application.coffee | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/application.coffee b/src/application.coffee index 8fffeda4..ce3b44c2 100644 --- a/src/application.coffee +++ b/src/application.coffee @@ -100,14 +100,15 @@ exports.start = start = (app) -> ] ) .then -> - container.attach {stream: true, stdout: true, stderr: true, tty: true}, (err, stream) -> - es.pipeline( - stream - es.split() - # Remove color escape sequences - es.mapSync((s) -> s.replace(/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]/g, '')) - es.mapSync(publish) - ) + container.attachAsync({ stream: true, stdout: true, stderr: true, tty: true }) + .then (stream) -> + es.pipeline( + stream + es.split() + # Remove color escape sequences + es.mapSync((s) -> s.replace(/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]/g, '')) + es.mapSync(publish) + ) .tap -> console.log('Started container:', app.imageId)