Permalink
Browse files

Revert "Cleaned up arguments escaping which was causing problems when…

… building with Rhino. Bump to 0.1.3"

This is breaking builds.

This reverts commit 5f52693.
  • Loading branch information...
1 parent 5f52693 commit bdc61997bfa35e90e5c557a532c74cce1d7b2fc2 @tolmasky tolmasky committed Mar 3, 2010
Showing with 17 additions and 16 deletions.
  1. +16 −15 lib/jake.js
  2. +1 −1 package.json
View
@@ -22,16 +22,14 @@
// IN THE SOFTWARE.
//
-var FILE = require("file");
-var SYSTEM = require("system");
-var UTIL = require("util");
-var OS = require("os");
+var FILE = require("file"),
+ SYSTEM = require("system"),
-var Task = require("jake/task").Task;
-var FileTask = require("jake/filetask").FileTask;
-var FileCreationTask = require("jake/filecreationtask").FileCreationTask;
-var TaskManager = require("jake/taskmanager").TaskManager;
-var Application = require("jake/application").Application;
+ Task = require("jake/task").Task,
+ FileTask = require("jake/filetask").FileTask,
+ FileCreationTask = require("jake/filecreationtask").FileCreationTask,
+ TaskManager = require("jake/taskmanager").TaskManager,
+ Application = require("jake/application").Application;
// Exports
exports.Task = Task;
@@ -108,26 +106,29 @@ exports.FileList = require("jake/filelist").FileList;
end
*/
-// record the initial SYSTEM.env so we know what needs to be serialized later
-var envInitial = Object.freeze(UTIL.copy(SYSTEM.env));
function serializeEnv(/*Object*/ env)
{
- return Object.keys(env).map(function(key) {
- return (env[key] !== envInitial[key]) ? key + "=" + OS.enquote(env[key]) : null;
- }).filter(function(x) { return !!x; }).join(" ");
+ var serialized = "";
+
+ for (variable in env)
+ if (env.hasOwnProperty(variable))
+ serialized += variable + "=\"" + env[variable] + "\" ";
+
+ return serialized;
}
exports.subjake = function(/*Array<String> | String*/ directories, /*String*/ aTaskName, /*Object*/ env)
{
if (!Array.isArray(directories))
directories = [directories];
+ var OS = require("os");
directories.forEach(function(/*String*/ aDirectory)
{
if (FILE.isDirectory(aDirectory))
{
- if (OS.system("cd " + OS.enquote(aDirectory) + " && " + serializeEnv(env) + " jake " + OS.enquote(aTaskName)))
+ if (OS.system("cd " + aDirectory + " && " + serializeEnv(env) + " jake " + aTaskName))
OS.exit(1);
}
});
View
@@ -3,5 +3,5 @@
"author": "Francisco Tolmasky (http://tolmasky.com/)",
"description": "A build system for CommonJS, lifted from Rake",
"keywords": ["build", "jake", "rake", "make"],
- "version":"0.1.3"
+ "version":"0.1.2"
}

0 comments on commit bdc6199

Please sign in to comment.