kopia lustrzana https://github.com/c9/core
fix error in cs50 workspace
rodzic
b1d0f9f247
commit
38f7c8399e
|
@ -0,0 +1,75 @@
|
||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
cd `dirname $0`/..
|
||||||
|
|
||||||
|
NAME=$1
|
||||||
|
URL=$2
|
||||||
|
if [ "$NAME" == "" ]; then
|
||||||
|
echo "add name [url]"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$URL" == "" ]; then
|
||||||
|
URL=git@github.com:c9/$NAME.git
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -d $NAME/.git ]; then
|
||||||
|
pushd $NAME
|
||||||
|
OLD_URL=$(git config --get remote.origin.url)
|
||||||
|
if [ "$OLD_URL" != "$URL" ]; then
|
||||||
|
echo "folder $NAME exists and points to $OLD_URL"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
git fetch origin
|
||||||
|
popd
|
||||||
|
else
|
||||||
|
mkdir -p $NAME
|
||||||
|
git clone $URL $NAME
|
||||||
|
fi
|
||||||
|
|
||||||
|
pushd $NAME
|
||||||
|
HASH=$(git rev-parse --revs-only refs/remotes/origin/master)
|
||||||
|
popd
|
||||||
|
|
||||||
|
[ -f ./config.json ] || echo "{}" > ./config.json
|
||||||
|
node -e '
|
||||||
|
var name = "'$NAME'";
|
||||||
|
var url = "'$URL'";
|
||||||
|
var hash = "'$HASH'"
|
||||||
|
var fs = require("fs");
|
||||||
|
|
||||||
|
function updateJSON(path, fn) {
|
||||||
|
var text = fs.readFileSync(path, "utf8");
|
||||||
|
var indent = text.match(/^\s*(?=")/m);
|
||||||
|
indent = indent && indent[0] || 4;
|
||||||
|
console.log(indent)
|
||||||
|
var r = JSON.parse(text);
|
||||||
|
r = fn(r) || r;
|
||||||
|
text = JSON.stringify(r, null, indent) + "\n";
|
||||||
|
fs.writeFileSync(path, text, "utf8");
|
||||||
|
}
|
||||||
|
|
||||||
|
updateJSON("./config.json", function(config) {
|
||||||
|
var packages = config.packages || (config.packages = {});
|
||||||
|
config.packages[name] = {
|
||||||
|
name: name,
|
||||||
|
hash: hash,
|
||||||
|
url: url,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
updateJSON("../package.json", function(package) {
|
||||||
|
var deps = package.dependencies;
|
||||||
|
console.log(deps[name], hash)
|
||||||
|
deps[name] = deps[name].replace(/#[a-f\d]+$/i, "#" + hash)
|
||||||
|
console.log(deps[name], hash)
|
||||||
|
});
|
||||||
|
updateJSON("../npm-shrinkwrap.json", function(package) {
|
||||||
|
var deps = package.dependencies;
|
||||||
|
deps[name].from = deps[name].from.replace(/#[a-f\d]+$/i, "#" + hash);
|
||||||
|
deps[name].resolved = deps[name].resolved.replace(/#[a-f\d]+$/i, "#" + hash);
|
||||||
|
});
|
||||||
|
'
|
||||||
|
|
||||||
|
rm -rf "../node_modules/$NAME"
|
||||||
|
ln -s `pwd`/$NAME `pwd`/../node_modules/$NAME
|
||||||
|
|
|
@ -368,7 +368,7 @@ define(function(require, module, exports) {
|
||||||
/**
|
/**
|
||||||
* @property {HTMLElement} container
|
* @property {HTMLElement} container
|
||||||
*/
|
*/
|
||||||
get container(){ return aml.$ext; },
|
get container(){ return aml && aml.$ext; },
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The area that this panel is a part of.
|
* The area that this panel is a part of.
|
||||||
|
|
|
@ -96,6 +96,20 @@ define(function(require, exports, module) {
|
||||||
};
|
};
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
try {
|
||||||
|
statics.addStatics(
|
||||||
|
fs.readdirSync(__dirname + "/../../integrations/").map(function(plugin) {
|
||||||
|
if (/^scripts$|\.(json|sh)$/.test(plugin))
|
||||||
|
return;
|
||||||
|
return {
|
||||||
|
path: __dirname + "/../../integrations/" + plugin,
|
||||||
|
mount: "/plugins/" + plugin
|
||||||
|
};
|
||||||
|
}).filter(Boolean)
|
||||||
|
);
|
||||||
|
} catch(e) {
|
||||||
|
}
|
||||||
|
|
||||||
statics.addStatics(fs.readdirSync(__dirname + "/../")
|
statics.addStatics(fs.readdirSync(__dirname + "/../")
|
||||||
.filter(function(path) {
|
.filter(function(path) {
|
||||||
if (path in blacklist)
|
if (path in blacklist)
|
||||||
|
|
|
@ -1102,7 +1102,7 @@ define(function(require, exports, module) {
|
||||||
expandedList[id] = node;
|
expandedList[id] = node;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
callback(err);
|
callback && callback(err);
|
||||||
tree.provider.on("changeScrollTop", scrollHandler);
|
tree.provider.on("changeScrollTop", scrollHandler);
|
||||||
|
|
||||||
emit("refreshComplete");
|
emit("refreshComplete");
|
||||||
|
|
Ładowanie…
Reference in New Issue