mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-25 04:57:03 +00:00
Fixed: Moved enquote function to utils package.
This function was originally in the Narwhal package OS
This commit is contained in:
+4
-9
@@ -126,11 +126,6 @@ function packageInCatalog(path)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// from narwhal
|
|
||||||
function enquote(word) {
|
|
||||||
return "'" + String(word).replace(/'/g, "'\"'\"'") + "'";
|
|
||||||
}
|
|
||||||
|
|
||||||
serializedENV = function()
|
serializedENV = function()
|
||||||
{
|
{
|
||||||
var envNew = {};
|
var envNew = {};
|
||||||
@@ -147,13 +142,13 @@ serializedENV = function()
|
|||||||
|
|
||||||
if (packages.length)
|
if (packages.length)
|
||||||
{
|
{
|
||||||
envNew["NARWHALOPT"] = packages.map(function(p) { return "-p " + enquote(p); }).join(" ");
|
envNew["NARWHALOPT"] = packages.map(function(p) { return "-p " + utilsFile.enquote(p); }).join(" ");
|
||||||
envNew["PATH"] = packages.map(function(p) { return path.join(p, "bin"); }).concat(process.env["PATH"]).join(":");
|
envNew["PATH"] = packages.map(function(p) { return path.join(p, "bin"); }).concat(process.env["PATH"]).join(":");
|
||||||
}
|
}
|
||||||
|
|
||||||
return Object.keys(envNew).map(function(key)
|
return Object.keys(envNew).map(function(key)
|
||||||
{
|
{
|
||||||
return key + "=" + enquote(envNew[key]);
|
return key + "=" + utilsFile.enquote(envNew[key]);
|
||||||
}).join(" ");
|
}).join(" ");
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -240,7 +235,7 @@ global.subjake = function(/*Array<String>*/ directories, /*String*/ aTaskName)
|
|||||||
{
|
{
|
||||||
if (fs.lstatSync(aDirectory).isDirectory() && fs.lstatSync(path.join(aDirectory, "Jakefile")).isFile())
|
if (fs.lstatSync(aDirectory).isDirectory() && fs.lstatSync(path.join(aDirectory, "Jakefile")).isFile())
|
||||||
{
|
{
|
||||||
var cmd = "cd " + enquote(aDirectory) + " && " + serializedENV() + " " + "jake" + " " + enquote(aTaskName);
|
var cmd = "cd " + utilsFile.enquote(aDirectory) + " && " + serializedENV() + " " + "jake" + " " + utilsFile.enquote(aTaskName);
|
||||||
var returnCode = systemSync(cmd);
|
var returnCode = systemSync(cmd);
|
||||||
|
|
||||||
if (returnCode) {
|
if (returnCode) {
|
||||||
@@ -431,7 +426,7 @@ var normalizeCommand = function(/*Array or String*/ command)
|
|||||||
if (Array.isArray(command))
|
if (Array.isArray(command))
|
||||||
return command.map(function (arg)
|
return command.map(function (arg)
|
||||||
{
|
{
|
||||||
return enquote(arg);
|
return utilsFile.enquote(arg);
|
||||||
}).join(" ");
|
}).join(" ");
|
||||||
else
|
else
|
||||||
return command;
|
return command;
|
||||||
|
|||||||
Reference in New Issue
Block a user