[bug]: Stacked compile producing malformed file on Windows
Describe the bug
Running stacked compile when developing stacked-org/cli on Windows causes the path strings in lib/src/templates/compiled_templates.dart to be malformed due to \ not being escaped.
But now for the fun part: this generated file contains errors on around 200 lines of code, but what can we do to fix this? Literally add a single character to two lines of code in another file. The only thing that would be easier is it being on one line... unless it would cause other problems (hasn't for me), hence no PR yet.
Proposed fix: add an "r" before '{{path}}' here and here to generate raw strings instead of strings in the compiled_templates.dart.
Oh, almost forgot to steal your joke: "Just use Linux" is not an easier solution than adding two "r":s 😊
What operating system do you use?
Windows
Information about the installed tooling
No response
Steps to reproduce the issue
- Clone stacked to windows machinge
- run "dart run bin/stacked.dart compile" in the repo
- Watch errors galore in your linter or with flutter analyze
Expected behavior
No response
Screenshots
No response
Additional Context
There is explicit instruction in compiled_templates.dart that it should be included in version control, don't know the reason for this so can't speak to the results of the file having \ path separator instead of / when pushed to upstream.
Haha. Yeah, windows will be a bit of a problem since neither me or @ferrarafer has a windows machine that we work with.
I'll label as p3 for now for us to fix, or you to make a PR if it becomes too bothersome.
Did a fairly simple fix, just a replaceAll on the paths before writing to the file to change all windows separators to Unix style.