Merge pull request +9217 from c9/remove-npm-updater

fix mode packaging
pull/149/head
Fabian Jakobs 2015-09-08 17:59:39 +02:00
commit 4984d78a49
1 zmienionych plików z 16 dodań i 7 usunięć

Wyświetl plik

@ -167,24 +167,33 @@ define(function(require, exports, module) {
var pathMap = {
"ace": __dirname + "/../../node_modules/ace/lib/ace",
"plugins": __dirname + "/../../plugins",
"plugins/salesforce.language": __dirname + "/../../node_modules/salesforce.language"
};
var packages = [
"ace",
"plugins/c9.ide.salesforce/salesforce.language",
"plugins/salesforce.language",
];
function toFsPath(id) {
var testPath = id, tail = "";
while (testPath) {
if (pathMap[testPath])
return pathMap[testPath] + tail;
var i = testPath.lastIndexOf("/");
if (i === -1) break;
tail = testPath.substr(i) + tail;
testPath = testPath.slice(0, i);
}
throw new Error("Cannot map path " + id);
}
function readPackage(name, type, excludePattern) {
if (!excludePattern)
excludePattern = /_test/;
var prefix = name.split("/")[0];
var targetPath = name + "/" + type;
if (!pathMap[prefix])
throw new Error("Cannot map prefix " + prefix + " for package " + name);
var sourcePath = pathMap[prefix] + "/" + targetPath.substr(prefix.length);
var sourcePath = toFsPath(targetPath);
try {
var files = fs.readdirSync(sourcePath);