Skip to content

Commit

Permalink
warn if resource in setupModules of jetty block cannot be resolved
Browse files Browse the repository at this point in the history
  • Loading branch information
mojavelinux committed Feb 15, 2024
1 parent bdde641 commit 2939dc9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/jetty-block.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,12 @@ function createExtensionGroup (context) {
const jettyModulesDir = ospath.join(jettyBase, 'modules')
fs.mkdirSync(jettyModulesDir, { recursive: true })
setupModules
.map((ref) => contentCatalog.resolveResource(ref.trim(), inSrc))
.forEach((jettyModuleFile) => {
if (!jettyModuleFile) return
.map((ref) => [contentCatalog.resolveResource(ref, inSrc), ref])
.filter(([resolved, ref]) => {
if (resolved) return true
log(doc, 'error', `resource in setupModules of jetty block could not be resolved: ${ref}`, cursor)
})
.forEach(([jettyModuleFile]) => {
const jettyModulePath = ospath.join(jettyModulesDir, jettyModuleFile.src.basename)
fs.writeFileSync(jettyModulePath, jettyModuleFile.contents, 'utf-8')
})
Expand Down

0 comments on commit 2939dc9

Please sign in to comment.