Skip to content

Commit

Permalink
Closes #26
Browse files Browse the repository at this point in the history
  • Loading branch information
davemackintosh committed Jul 14, 2015
1 parent b671e98 commit 0f5423b
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion lib/create-container.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,18 @@ function pull (docker, image, done) {

streamc
.pipe(es.map(function (data, cb) {
cb(null, JSON.parse(data))
var json_data = null

try {
json_data = JSON.parse(data.toString())
} catch (error) {
json_data = {
type: 'stdout',
data: data.toString()
}
}

cb(null, json_data)
}))
.on('data', function (event) {
debug('pull event: ' + inspect(event));
Expand Down

0 comments on commit 0f5423b

Please # to comment.