Skip to content

Commit

Permalink
fix: ensure forms workaround globbing works in windows
Browse files Browse the repository at this point in the history
  • Loading branch information
orinokai committed Jul 4, 2024
1 parent 4fc0485 commit 7b13326
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/build/verification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,13 @@ const formDetectionRegex = /<form[^>]*?\s(netlify|data-netlify)[=>\s]/

export async function verifyNetlifyFormsWorkaround(ctx: PluginContext) {
const srcDir = ctx.resolveFromSiteDir('public')
const paths = await glob(join(srcDir, '**/*.html'))
const paths = await glob('**/*.html', {
cwd: srcDir,
dot: true,
})
try {
for (const path of paths) {
const html = await readFile(path, 'utf-8')
const html = await readFile(join(srcDir, path), 'utf-8')
if (formDetectionRegex.test(html)) {
verifications.add('netlifyFormsWorkaround')
return
Expand Down

0 comments on commit 7b13326

Please sign in to comment.