From 0bfbee55236c8c1670713be22d4faf16cf272d89 Mon Sep 17 00:00:00 2001 From: Daniel Lockyer Date: Thu, 6 Oct 2022 15:58:51 +0700 Subject: [PATCH] Fixed `yarn dev --stripe` ignoring HTTPS configured sites - because the cwd of `.github/dev.js` is not `ghost/core`, it doesn't pick up config.local.json files, so any configuration you set in there isn't applied - this meant that developers with HTTPS configured locally couldn't use `--stripe` because it wouldn't configure the Stripe listening URL correctly - this adds an exports to the config lib to allow passing options in, which I then utilize to pass the directory that config resides in - this should fix the aforementioned problem with HTTPS --- .github/dev.js | 5 ++++- ghost/core/core/shared/config/index.js | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/dev.js b/.github/dev.js index 298a62b823..31cff73f68 100644 --- a/.github/dev.js +++ b/.github/dev.js @@ -4,7 +4,10 @@ const exec = util.promisify(require('child_process').exec); const concurrently = require('concurrently'); -const config = require('../ghost/core/core/shared/config'); +const config = require('../ghost/core/core/shared/config').withOptions({ + customConfigPath: path.join(__dirname, '../ghost/core') +}); + const liveReloadBaseUrl = config.getSubdir() || '/ghost/'; const siteUrl = config.getSiteUrl(); diff --git a/ghost/core/core/shared/config/index.js b/ghost/core/core/shared/config/index.js index 228b50b66c..870e75d82b 100644 --- a/ghost/core/core/shared/config/index.js +++ b/ghost/core/core/shared/config/index.js @@ -1,3 +1,4 @@ const loader = require('./loader'); module.exports = loader.loadNconf(); +module.exports.withOptions = (options) => loader.loadNconf(options);