now using sudo only when necessary

This commit is contained in:
Alfred Wärnsäter
2021-08-19 13:59:43 +02:00
parent 7226019b6a
commit abbdc139e8
2 changed files with 1 additions and 2 deletions
-1
View File
@@ -42,7 +42,6 @@ filedir ($BUILD_CJS_CAPPUCCINO_DEBUG_FRAMEWORKS, ["debug", "release"], function(
}); });
task ("CommonJS", [$BUILD_CJS_OBJECTIVE_J_DEBUG_FRAMEWORKS, $BUILD_CJS_CAPPUCCINO_DEBUG_FRAMEWORKS, "debug", "release"], function() { task ("CommonJS", [$BUILD_CJS_OBJECTIVE_J_DEBUG_FRAMEWORKS, $BUILD_CJS_CAPPUCCINO_DEBUG_FRAMEWORKS, "debug", "release"], function() {
console.log("in commonjs action");
}); });
task ("install", ["CommonJS"], function() task ("install", ["CommonJS"], function()
+1 -1
View File
@@ -454,7 +454,7 @@ global.installCopy = function(sourcePath, useSudo)
fs.readdirSync(binPath).forEach(function (name) fs.readdirSync(binPath).forEach(function (name)
{ {
var prefix = child_process.execSync("npm prefix -g").toString().trim(); var prefix = child_process.execSync("npm prefix -g").toString().trim();
child_process.execSync("sudo ln -sf " + path.join(binPath, name) + " " + path.join(prefix, "bin", name)); child_process.execSync( (useSudo ? "sudo " : "") + "ln -sf " + path.join(binPath, name) + " " + path.join(prefix, "bin", name));
}); });
}; };