Skip to content

fix: duplicate path error problem issue(#610)#621

Open
Arunanshu655 wants to merge 1 commit intotypelevel:mainfrom
Arunanshu655:Arunanshu1
Open

fix: duplicate path error problem issue(#610)#621
Arunanshu655 wants to merge 1 commit intotypelevel:mainfrom
Arunanshu655:Arunanshu1

Conversation

@Arunanshu655
Copy link
Copy Markdown

Hey everyone! 👋
I was trying to set up the site locally on Windows and ran into a build error ( basically duplicate path error) that made it impossible to run.

What was happening

On LINUX/macOS, folders starting with a dot (like .well-known) are hidden at the OS level, so when Laika scans the src/ directory it skips .well-known entirely. Then the explicit .addDirectory("src/.well-known", ...) call in LaikaBuild.input adds it back at the correct virtual path — everything works as intended.
On Windows however, dot-folders are not hidden by default. So Laika's directory scan picks up src/.well-known from addDirectory("src"), and then the explicit addDirectory("src/.well-known", ...) tries to register the same path a second time — causing a duplicate path error that crashes the build before it even starts.

What I have done

I get a reference to the src/.well-known path, check if it exists, and if it does I set the dos:hidden attribute on it using java.nio.file.Files.setAttribute — so Windows treats it the same way Linux/macOS does natively. This uses standard Java NIO which is available on any JDK, so it should work consistently across all Windows machines. On Linux/macOS this block is skipped entirely, so existing workflows are completely unaffected.

I think this PR is relevant to the issue no. #610

@armanbilge if possible please review my PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant