Skip to content

Commit

Permalink
Update distributables
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesMGreene committed Nov 23, 2022
1 parent e5c1ee9 commit 2f460cf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15757,6 +15757,8 @@ const core = __nccwpck_require__(2186)
const { ConfigParser } = __nccwpck_require__(8395)
const removeTrailingSlash = __nccwpck_require__(9255)

const SUPPORTED_FILE_EXTENSIONS = ['.js', '.cjs', '.mjs']

// Return the settings to be passed to a {ConfigParser} for a given static site generator,
// optional configuration file path, and a Pages siteUrl value to inject
function getConfigParserSettings({ staticSiteGenerator, generatorConfigFile, siteUrl }) {
Expand Down Expand Up @@ -15831,12 +15833,14 @@ function setPagesConfig({ staticSiteGenerator, generatorConfigFile, siteUrl }) {
const settings = getConfigParserSettings({ staticSiteGenerator, generatorConfigFile, siteUrl })
new ConfigParser(settings).injectAll()
} catch (error) {
const supportedFileExtension = ['.js', '.cjs', '.mjs'].some(extension => generatorConfigFile.endsWith(extension))
const isSupportedFileExtension = SUPPORTED_FILE_EXTENSIONS.some(ext => generatorConfigFile.endsWith(ext))

// Logging
if (!supportedFileExtension) {
if (!isSupportedFileExtension) {
core.warning(
`We were unable to determine how to inject the site metadata into your config. Currently we only support ".js", ".cjs" and ".mjs".`,
`Unsupported configuration file extension. Currently supported extensions: ${SUPPORTED_FILE_EXTENSIONS.map(
ext => JSON.stringify(ext)
).join(', ')}`,
error
)
} else {
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

0 comments on commit 2f460cf

Please sign in to comment.