Skip to content

Instantly share code, notes, and snippets.

@canonic-epicure
Created September 3, 2010 15:28
Show Gist options
  • Save canonic-epicure/564039 to your computer and use it in GitHub Desktop.
Save canonic-epicure/564039 to your computer and use it in GitHub Desktop.
calc_hashes : function (strings_array) {
var cont = this.CONT
Joose.A.each(strings_array, function (string) {
cont.AND(function () {
var THROW = this.getTHROW()
var CONTINUE = this.getCONTINUE()
exec('echo -n ' + '\'' + string + '\'' + ' | md5sum', function (error, stdout, stderr) {
if (error != null)
THROW(error)
else
CONTINUE(stdout, stderr)
})
})
})
cont.andThen(function () {
Joose.A.each(arguments, function (result, index) {
var stdout = result[0]
var stderr = result[1]
})
this.CONTINUE(arguments) // XXX w/o this line the code will just stop here
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment