0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-13 22:41:32 -05:00

Merge pull request #6539 from ErisDS/about-page-images

Fetch about page images properly
This commit is contained in:
Sebastian Gierlinger 2016-02-18 15:16:41 +01:00
commit c3099a3c8c

View file

@ -839,8 +839,11 @@ var _ = require('lodash'),
downloadImagePromise = function (url, name) { downloadImagePromise = function (url, name) {
return new Promise(function (resolve, reject) { return new Promise(function (resolve, reject) {
https.get(url, function (res) { var file = fs.createWriteStream(path.join(__dirname, imagePath, name));
fs.writeFile(imagePath + name, res, function () { https.get(url, function (response) {
response.pipe(file);
file.on('finish', function () {
file.close();
resolve(); resolve();
}); });
}) })