Ability to override the default warehouse url base

Hope this one does override!
This commit is contained in:
Wexpo Lyu
2016-07-09 16:17:45 +08:00
committed by GitHub
parent 126b9172c7
commit a8b8038d95

View File

@@ -299,6 +299,12 @@ _.extend(exports.Tropohouse.prototype, {
// XXX: Error handling.
_downloadBuildToTempDir: function (versionInfo, buildRecord) {
var url = buildRecord.build.url;
// Override the download domain name and protocol if METEOR_WAREHOUSE_URLBASE
// provided.
if (process.env.METEOR_WAREHOUSE_URLBASE) {
url = url.replace(/^[a-zA-Z]+:\/\/[^\/]+/, process.env.METEOR_WAREHOUSE_URLBASE);
}
// XXX: We use one progress for download & untar; this isn't ideal:
// it relies on extractTarGz being fast and not reporting any progress.