fix: duplicate path error problem issue(#610)#621
Open
Arunanshu655 wants to merge 1 commit intotypelevel:mainfrom
Open
fix: duplicate path error problem issue(#610)#621Arunanshu655 wants to merge 1 commit intotypelevel:mainfrom
Arunanshu655 wants to merge 1 commit intotypelevel:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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