@@ -461,9 +461,8 @@ ProcessProxy.prototype.executeCommand = function(command) {
461461
462462 . then ( function ( cmdResults ) {
463463
464- for ( var cmd in cmdResults ) {
465- fulfill ( cmdResults [ cmd ] ) ;
466- }
464+ fulfill ( cmdResults [ 0 ] ) ;
465+
467466
468467 } ) . catch ( function ( error ) {
469468 reject ( error ) ;
@@ -475,14 +474,16 @@ ProcessProxy.prototype.executeCommand = function(command) {
475474
476475/**
477476* executeCommands - takes an array of raw command strings and returns promise
478- * to be fulfilled with a a hash
479- * of "command" -> {command:cmd, stdout:xxxx, stderr:xxxxx}
477+ * to be fulfilled with a an array of
478+ * of [
479+ * {command:cmd1, stdout:xxxx, stderr:xxxxx},
480+ * {command:cmd2, stdout:xxxx, stderr:xxxxx}
481+ * ]
480482*
481483* @commands Array of raw command/shell statements to be executed
482484*
483485* @return Promise, on fulfill returns promise to be fulfilled with a
484- * hash of commands -> {stdout:xxxx, stderr:xxxxx}
485- * on reject returns an exception
486+ * array of command results as described above
486487*
487488**/
488489ProcessProxy . prototype . executeCommands = function ( commands ) {
@@ -493,7 +494,7 @@ ProcessProxy.prototype.executeCommands = function(commands) {
493494
494495 try {
495496
496- var cmdResults = new Object ( ) ;
497+ var cmdResults = [ ] ;
497498
498499 for ( var i = 0 ; i < commands . length ; i ++ ) {
499500
@@ -505,13 +506,13 @@ ProcessProxy.prototype.executeCommands = function(commands) {
505506 new Command ( command ,
506507 function ( cmd , stdout , stderr ) {
507508
508- cmdResults [ cmd ] = {
509- 'command' : cmd ,
510- 'stdout' : stdout ,
511- 'stderr' : stderr
512- } ;
509+ cmdResults . push ( {
510+ 'command' : cmd ,
511+ 'stdout' : stdout ,
512+ 'stderr' : stderr
513+ } ) ;
513514
514- if ( Object . keys ( cmdResults ) . length == commands . length ) {
515+ if ( cmdResults . length == commands . length ) {
515516 fulfill ( cmdResults ) ;
516517 }
517518
0 commit comments