From a8b8038d95ee33834c06fa8fd7470521bb034eac Mon Sep 17 00:00:00 2001 From: Wexpo Lyu Date: Sat, 9 Jul 2016 16:17:45 +0800 Subject: [PATCH] Ability to override the default warehouse url base Hope this one does override! --- tools/packaging/tropohouse.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/packaging/tropohouse.js b/tools/packaging/tropohouse.js index a30719a232..1e416f9c6b 100644 --- a/tools/packaging/tropohouse.js +++ b/tools/packaging/tropohouse.js @@ -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.