(cmd, args, opts)
| 203 | // Execute a given command, and return a promise to its output. |
| 204 | // Don't denodeify here, since fail branch needs access to stderr. |
| 205 | function execFile(cmd, args, opts) { |
| 206 | const deferred = Q.defer(); |
| 207 | childProcess.execFile(cmd, args, opts, function(err, stdout, stderr) { |
| 208 | if (err) { |
| 209 | console.error("Error executing " + cmd + " " + args.join(" ")); |
| 210 | console.error(stdout + stderr); |
| 211 | err.stdout = stdout; |
| 212 | err.stderr = stderr; |
| 213 | deferred.reject(err); |
| 214 | } else { |
| 215 | deferred.resolve(stdout); |
| 216 | } |
| 217 | }); |
| 218 | return deferred.promise; |
| 219 | } |
| 220 | |
| 221 | // Read given file and parse it as a PNG file. |
| 222 | function readPNG(file) { |
no test coverage detected
searching dependent graphs…