var exec = require('child_process').exec

module.exports.asyncIterate = function(array, callback, done) {
    function iterate(idx) {
        var current = array[idx]

        if (current) {
            callback(current, function() { iterate(idx+1) }, function(err) { done(err) })
        } else {
            done()
        }
    }

    iterate(0)
}

module.exports.checkRunning = function(container, callback) {
    exec('docker inspect ' + container.name, function(err) {
        var isRunning = err ? false : true 
        callback(isRunning)
    })
}


@@ -33,16 +33,47 @@
 s').exec
+,%0A       _ = require('lodash')%0A
 %0A%0Amodule
@@ -495,16 +495,24 @@
 tion(err
+, stdout
 ) %7B%0A    
@@ -519,44 +519,196 @@
     
-var isRunning = err ? false : true %0A
+if (err) %7B%0A            callback(false)%0A        %7D else %7B%0A            var info = _.head(JSON.parse(stdout))%0A            var isRunning = info && info.State ? !!info.State.Running : false%0A    
     
@@ -731,16 +731,26 @@
 unning)%0A
+        %7D%0A
     %7D)%0A%7D

Fix “checkRunning” to return right container’s running status