Skip to content

Commit

Permalink
fix: ensure forms test is actually testing!
Browse files Browse the repository at this point in the history
  • Loading branch information
orinokai committed Jul 3, 2024
1 parent a964c7a commit 62faedc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/build/verification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,12 @@ export async function verifyNetlifyFormsWorkaround(ctx: PluginContext) {
const srcDir = ctx.resolveFromSiteDir('public')
const paths = await glob(join(srcDir, '**/*.html'))
try {
const hasWorkaround = await paths.some(async (path): Promise<boolean> => {
for (const path of paths) {
const html = await readFile(path, 'utf-8')
return formDetectionRegex.test(html)
})
if (hasWorkaround) {
verifications.add('netlifyFormsWorkaround')
if (formDetectionRegex.test(html)) {
verifications.add('netlifyFormsWorkaround')
return
}
}
} catch (error) {
ctx.failBuild('Failed verifying public files', error)
Expand Down

0 comments on commit 62faedc

Please sign in to comment.