0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00

Fetch about page images properly

- Apparently I really didn't test this very well...
... turns out I was looking at the built assets folder instead of the client/public folder
... and this wasn't working at all
😭
This commit is contained in:
Hannah Wolfe 2016-02-18 13:49:42 +00:00
parent ae6e0dd94d
commit 398b07c9c2

View file

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