Use files.getUrl instead of ad-hoc solution

This commit is contained in:
Avital Oliver
2012-12-14 17:45:26 -08:00
committed by David Glasser
parent 55349ca974
commit 460911c406

View File

@@ -429,15 +429,7 @@ var packages = module.exports = {
// load the manifest from s3, and store in the cache
try {
// a variation on request that has a standard (error, result) callback.
// this way we can use Future.wrap
var request2 = function(url, cb) {
request(url, function(error, response, body) {
cb(error, body);
});
};
var manifest = Future.wrap(request2)(
var manifest = Future.wrap(files.getUrl)(
PACKAGES_URLBASE + "/manifest/" + releaseVersion + ".json").wait();
fs.writeFileSync(manifestPath, manifest);
return JSON.parse(manifest);