From 5b3b62f93da4b7b19e24ccf72d9ce20b9edce6d5 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Tue, 24 Jun 2014 12:09:10 +0100 Subject: [PATCH] Fix bug handling of build command We were taking the commands expanded from the build targets and placing them at the end of the queue. That caused a problem whereby the prevailing output folder was always the last one in the command token list. Now we splice the new commands into the command token list at the current position. --- core/modules/commander.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/modules/commander.js b/core/modules/commander.js index 8cf0d0b0b..35e45d12d 100644 --- a/core/modules/commander.js +++ b/core/modules/commander.js @@ -33,7 +33,10 @@ var Commander = function(commandTokens,callback,wiki,streams) { Add a string of tokens to the command queue */ Commander.prototype.addCommandTokens = function(commandTokens) { - Array.prototype.push.apply(this.commandTokens,commandTokens); + var params = commandTokens.slice(0); + params.unshift(0); + params.unshift(this.nextToken); + Array.prototype.splice.apply(this.commandTokens,params); }; /*