use npm prefix for install path

This commit is contained in:
Alfred Wärnsäter
2021-08-19 13:30:40 +02:00
parent 78ea29bd48
commit 7226019b6a
3 changed files with 7 additions and 2 deletions
-1
View File
@@ -368,7 +368,6 @@ function createThemesInFile(/*Array*/ themes, /*String*/ aFile, /*Boolean*/ syml
{
var themeFolder = theme + ".blend",
path = node_path.join(themesBuild, themeFolder);
console.log("createThemesInFile: " + path);
if (!fs.lstatSync(path).isDirectory())
fail("Cannot find theme " + themeFolder + " in " + themesBuild);
+2 -1
View File
@@ -453,7 +453,8 @@ global.installCopy = function(sourcePath, useSudo)
}
fs.readdirSync(binPath).forEach(function (name)
{
child_process.execSync("sudo ln -sf " + path.join(binPath, name) + " /usr/local/bin/" + name);
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));
});
};
+5
View File
@@ -25,5 +25,10 @@
"press": "dist/cappuccino/bin/press",
"objj": "dist/cappuccino/bin/objj",
"jake": "dist/cappuccino/bin/jake"
},
"license": "LGPL-2.1-only",
"repository": {
"type": "git",
"url": "https://github.com/cappuccino/cappuccino.git"
}
}