mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-27 22:49:56 -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:
parent
f1638b869c
commit
6dd821bd41
1 changed files with 4 additions and 4 deletions
|
@ -48,7 +48,9 @@ module.exports = class AssetsMinificationBase {
|
||||||
|
|
||||||
async minify(globs, options) {
|
async minify(globs, options) {
|
||||||
try {
|
try {
|
||||||
return await this.minifier.minify(globs, options);
|
const result = await this.minifier.minify(globs, options);
|
||||||
|
this.ready = true;
|
||||||
|
return result;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error.code === 'EACCES') {
|
if (error.code === 'EACCES') {
|
||||||
logging.error('Ghost was not able to write asset files due to permissions.');
|
logging.error('Ghost was not able to write asset files due to permissions.');
|
||||||
|
@ -56,8 +58,6 @@ module.exports = class AssetsMinificationBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
throw error;
|
throw error;
|
||||||
} finally {
|
|
||||||
this.ready = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue