Skip to content

Commit

Permalink
Removed used of fs-extra from @tryghost/logging
Browse files Browse the repository at this point in the history
ref SLO-14
ref https://linear.app/tryghost/issue/SLO-14/improved-speed-of-migratejs-script

- fs-extra can be a really heavy library when you're trying to stay lean
- we don't need it here because `fs` natively comes with a sync `exists`
  method
- this replaces `fs-extra` with `fs`
  • Loading branch information
daniellockyer committed Mar 11, 2024
1 parent d1ac2c7 commit 656b480
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/logging/lib/GhostLogger.js
Expand Up @@ -5,7 +5,7 @@ const isObject = require('lodash/isObject');
const isEmpty = require('lodash/isEmpty');
const includes = require('lodash/includes');
const bunyan = require('bunyan');
const fs = require('fs-extra');
const fs = require('fs');
const jsonStringifySafe = require('json-stringify-safe');

/**
Expand Down Expand Up @@ -287,7 +287,7 @@ class GhostLogger {
const sanitizedDomain = this.domain.replace(/[^\w]/gi, '_');

// CASE: target log folder does not exist, show warning
if (!fs.pathExistsSync(this.path)) {
if (!fs.existsSync(this.path)) {
this.error('Target log folder does not exist: ' + this.path);
return;
}
Expand Down

0 comments on commit 656b480

Please sign in to comment.