0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00

Fixed setting minification ready state upon failure (#21294)

- this will prevent the `ready` variable from being set to true if there
is an error with minification, as we have not correctly generated the
assets yet
This commit is contained in:
Daniel Lockyer 2024-10-14 16:09:50 +02:00 committed by GitHub
parent f1638b869c
commit 6dd821bd41
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -48,16 +48,16 @@ module.exports = class AssetsMinificationBase {
async minify(globs, options) {
try {
return await this.minifier.minify(globs, options);
const result = await this.minifier.minify(globs, options);
this.ready = true;
return result;
} catch (error) {
if (error.code === 'EACCES') {
logging.error('Ghost was not able to write asset files due to permissions.');
return;
}
throw error;
} finally {
this.ready = true;
throw error;
}
}