diff --git a/core/client b/core/client index af851469b0..7e8c8585a1 160000 --- a/core/client +++ b/core/client @@ -1 +1 @@ -Subproject commit af851469b052a8a01f712442119a7baaf0bfbfdd +Subproject commit 7e8c8585a16fd06ac0bedc9352175a8bc5de03a7 diff --git a/core/frontend/services/card-assets/service.js b/core/frontend/services/card-assets/service.js index 285577af13..b450f66d74 100644 --- a/core/frontend/services/card-assets/service.js +++ b/core/frontend/services/card-assets/service.js @@ -2,6 +2,7 @@ const Minifier = require('@tryghost/minifier'); const _ = require('lodash'); const path = require('path'); const fs = require('fs').promises; +const logging = require('@tryghost/logging'); class CardAssetService { constructor(options = {}) { @@ -49,7 +50,14 @@ class CardAssetService { } async minify(globs) { - return await this.minifier.minify(globs); + try { + return await this.minifier.minify(globs); + } catch (err) { + // @TODO: Convert this back to a proper error once the underlying bug is fixed + if (err.code === 'EACCES') { + logging.warn('Ghost was not able to write card asset files due to permissions.'); + } + } } async clearFiles() { @@ -59,8 +67,8 @@ class CardAssetService { try { await fs.unlink(path.join(this.dest, 'cards.min.css')); } catch (error) { - // Don't worry if the file didn't exist - if (error.code !== 'ENOENT') { + // Don't worry if the file didn't exist or we don't have perms here + if (error.code !== 'ENOENT' && error.code !== 'EACCES') { throw error; } } @@ -68,8 +76,8 @@ class CardAssetService { try { await fs.unlink(path.join(this.dest, 'cards.min.js')); } catch (error) { - // Don't worry if the file didn't exist - if (error.code !== 'ENOENT') { + // Don't worry if the file didn't exist or we don't have perms here + if (error.code !== 'ENOENT' && error.code !== 'EACCES') { throw error; } } @@ -94,7 +102,7 @@ class CardAssetService { const globs = this.generateGlobs(); - this.files = await this.minify(globs); + this.files = await this.minify(globs) || []; } } diff --git a/package.json b/package.json index 2384b3b238..911e210710 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ghost", - "version": "4.22.2", + "version": "4.22.3", "description": "The professional publishing platform", "author": "Ghost Foundation", "homepage": "https://ghost.org",