Skip to content

Commit

Permalink
Merge pull request #35 from Strider-CD/syntax-error-stdout-26
Browse files Browse the repository at this point in the history
Closes #26
  • Loading branch information
Ilya Radchenko committed Jul 14, 2015
2 parents b671e98 + 0f5423b commit b74f83f
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 b74f83f

Please # to comment.