Skip to content

Commit

Permalink
fix: debug-links provider
Browse files Browse the repository at this point in the history
  • Loading branch information
devthejo committed Mar 18, 2024
1 parent 1bab305 commit 8edde8c
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions plugins/fabrique/pre-deploy/01-debug-links.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
/* eslint-disable import/no-extraneous-dependencies, import/no-unresolved, import/extensions */

const getManifestsSummaryImport = import(
"@socialgouv/parse-manifests/src/getManifestsSummary.js"
)
const summaryToTextImport = import(
"@socialgouv/parse-manifests/src/summaryToText.js"
)

module.exports = async (manifests, _options, { logger, utils }) => {
module.exports = async (manifests, _options, { config, logger, utils }) => {
let envProviderOrigin
if (process.env.PROVIDER) {
envProviderOrigin = process.env.PROVIDER
}
process.env.PROVIDER = config.provider

const getManifestsSummaryImport = import(
"@socialgouv/parse-manifests/src/getManifestsSummary.js"
)
const summaryToTextImport = import(
"@socialgouv/parse-manifests/src/summaryToText.js"
)

const getManifestsSummary = (await getManifestsSummaryImport).default
const summaryToText = (await summaryToTextImport).default

Expand All @@ -27,4 +33,8 @@ module.exports = async (manifests, _options, { logger, utils }) => {
line = utils.removePrefix(line, "### ")
log.debug(line)
})

if (envProviderOrigin) {
process.env.PROVIDER = envProviderOrigin
}
}

0 comments on commit 8edde8c

Please sign in to comment.