Skip to content

Commit c599fd5

Browse files
gnodetclaude
andcommitted
Ignore .camel-jbang directories in docs gulp build
The gulp glob pattern dsl/**/src/main/docs/*.adoc scans recursively through the dsl/ tree, racing with camel-jbang-core tests that create/delete .camel-jbang/work directories. Add .camel-jbang to the ignore list alongside target to prevent ENOENT errors. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 1cff3d0 commit c599fd5

1 file changed

Lines changed: 22 additions & 2 deletions

File tree

docs/gulpfile.js

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,18 @@ const tasks = Array.from(sourcesMap).flatMap(([type, definition]) => {
326326
}
327327
})
328328

329-
return gulp.src(source, { ignore: ['**/target/**'] })
329+
const stream = gulp.src(source, { ignore: ['**/target/**', '**/.camel-jbang/**'], allowEmpty: true })
330+
// Ignore ENOENT errors from ephemeral directories (e.g. target/ temp dirs
331+
// created/deleted by tests running in parallel via mvnd)
332+
stream.on('error', (err) => {
333+
if (err.code === 'ENOENT') {
334+
console.warn(`⚠️ Ignoring ENOENT during glob scan: ${err.path}`)
335+
stream.emit('end')
336+
} else {
337+
stream.destroy(err)
338+
}
339+
})
340+
return stream
330341
.pipe(filterFn)
331342
.pipe(
332343
map((file, done) => {
@@ -409,7 +420,16 @@ const tasks = Array.from(sourcesMap).flatMap(([type, definition]) => {
409420
return done()
410421
}
411422

412-
return gulp.src(source, { ignore: ['**/target/**'] }) // asciidoc files
423+
const stream = gulp.src(source, { ignore: ['**/target/**', '**/.camel-jbang/**'], allowEmpty: true }) // asciidoc files
424+
stream.on('error', (err) => {
425+
if (err.code === 'ENOENT') {
426+
console.warn(`⚠️ Ignoring ENOENT during glob scan: ${err.path}`)
427+
stream.emit('end')
428+
} else {
429+
stream.destroy(err)
430+
}
431+
})
432+
return stream
413433
.pipe(through2.obj(extractExamples)) // extracted example files
414434
// symlink links from a fixed directory, i.e. we could link to
415435
// the example files from `destination`, that would not work for

0 commit comments

Comments
 (0)