-
Notifications
You must be signed in to change notification settings - Fork 407
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pattern subdir property contains incorrect directory separator on windows #559
Comments
Hi, I´m working with PL on MacOSX and now tried my project on Windows and run into this bug. Ißm also using verbose mustache include syntax. I investigated and found it´s a dir separator issue. I added a line in pattern_assembler.js to get it working, I´m sure this is not the correct fix but gives a hint.
Now when I get that fixed, there´s a new issue with those partial includes. It only allows me to include a pattern that is further up in the file ordering. So a structure like 00-pattern I can´t include pattern2 in pattern1. Once I change it to different order it works like: 00-pattern This happened to me only on Windows using verbose include syntax once I added my fix. It seems that when using the shorthand syntax it works fine. Not sure what is happening. Thanks, any help appereciated to fix this. |
@somatonic we (seemingly) managed to fix it with adding 2 lines in
It should replace the slashes found in partials with correct path separators. But I haven't gotten around to sumbit a PR :/ |
Thanks @sandrojohanides. I tried this out and it's not working. This replaces only the first occurence of "/" and if you have subdirs it ends up "00-pattern\pattern1/pattern1". I changed it to:
But then the check in pattern_assembler.js will fail for certain patterns still. So I added my code path.sep there and it started working all again,
to
Also the wierd behaviour I have is gone with file order of partials playing a role. Thanks |
No, thank you, it's great to have an all-around working solution. I'll try it out on monday. |
Hey @sandrojohanides @somatonic nice work. Any issues with the fix mentioned? Will you be creating a pull request? |
closing this due to inactivity. OP or anyone still experiencing an issue - feel free to bump this again. |
Fix the verbose partial closes #559
I am using Pattern Lab Node
v1.3.4
onWindows
, with Nodev6.9.1
, using theGulp
Edition.Expected Behavior
Pattern object subdir property should contain forward slash
/
Actual Behavior
Pattern object subdir property contains backslash
\\
showing an errorCould not find pattern referenced with partial syntax ' + partialName + '. This can occur when a pattern was renamed, moved, or no longer exists but it still called within a different template somewhere.
Steps to Reproduce
Try to include partial in mustache template using Default Include Syntax
{{> dir/subdir/partial }}
on windowsThe text was updated successfully, but these errors were encountered: