-
-
Notifications
You must be signed in to change notification settings - Fork 217
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
Fix windows breaking paths #317
Fix windows breaking paths #317
Conversation
Using "/" as file separator for windows to avoid conflicts with mustache.
Thanks a lot @swarajsaaj |
As some of this code is very close to NubesGen.com you probably have the same errors I had there on Windows. It’s fixed in NubesGen, we should share code on this. |
Codecov Report
@@ Coverage Diff @@
## main #317 +/- ##
===========================================
Coverage 100.00% 100.00%
- Complexity 456 458 +2
===========================================
Files 80 80
Lines 1453 1456 +3
Branches 32 32
===========================================
+ Hits 1453 1456 +3
Continue to review full report at Codecov.
|
@@ -27,6 +28,8 @@ | |||
|
|||
private final Logger log = LoggerFactory.getLogger(ProjectLocalRepository.class); | |||
|
|||
private final boolean isPosix = FileSystems.getDefault().supportedFileAttributeViews().contains("posix"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would move this to a static method in FileUtils, as it's not something which is related to ProjectRepository
Then, if you don't know how to add a unit test, ping me, I can help
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @pascalgrimaud ,
Thanks for the review, I have moved the check to FileUtils
, and for the test case I have attempted writing a non-windows test case (from a win machine) with mocked static method, let me know if it can be improved? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes the solution is to use mocked static :-)
@@ -124,7 +128,7 @@ public void setExecutable(Project project, String source, String sourceFilename) | |||
|
|||
perms.add(PosixFilePermission.OTHERS_READ); | |||
perms.add(PosixFilePermission.OTHERS_EXECUTE); | |||
|
|||
System.out.println(getPath(project.getFolder())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just remove this system out and we should be good :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops.
Removed it
Thanks for your contributions @swarajsaaj |
Thanks for all the help @pascalgrimaud 👍 |
Getting the generator run in windows:-
mustache.
Note:- If using "\" (File.separator on windows) its not possible to generate the project at all, so replacing it with more universal "/"
Exception in mustache when using "" as file separator from