Skip to content

Commit b74f83f

Browse files
author
Ilya Radchenko
committed
Merge pull request #35 from Strider-CD/syntax-error-stdout-26
Closes #26
2 parents b671e98 + 0f5423b commit b74f83f

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

lib/create-container.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,18 @@ function pull (docker, image, done) {
2929

3030
streamc
3131
.pipe(es.map(function (data, cb) {
32-
cb(null, JSON.parse(data))
32+
var json_data = null
33+
34+
try {
35+
json_data = JSON.parse(data.toString())
36+
} catch (error) {
37+
json_data = {
38+
type: 'stdout',
39+
data: data.toString()
40+
}
41+
}
42+
43+
cb(null, json_data)
3344
}))
3445
.on('data', function (event) {
3546
debug('pull event: ' + inspect(event));

0 commit comments

Comments
 (0)