This repository has been archived by the owner on Feb 9, 2019. It is now read-only.
Fix for issue [Dust] Generated template doesn't work on Windows #3
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.
Hello,
It's my first pull-request, so I try to not make trouble.
This pull-request answers the issue I created. I closed it because it's a duplicate now.
This issue is related to https://groups.google.com/forum/?fromgroups&hl=fr#!searchin/play-framework/2.0$20dust/play-framework/2n4aYP45H6Q/Q3tE5YSlOJIJ
There is a little issue using it on Windows. The generated template looks like this :
(function(){dust.register("D:\dev\play-plugins\dust\sample\app\assets\example.tl",body_0);...
which doesn't work !
The mistake is in https://github.com/typesafehub/play-plugins/blob/master/dust/src/main/scala/com/typesafe/plugin/DustTasks.scala.
The last character added to
assertDir
is/
, before replacement by""
which works on Linux/Mac but not on Windows ;)To fix this issue, I made 2 changes:
assertDir + "/"
by""
, I drop the last character which is/
</code>
</code> by
/
to have a right path in case templates files are in a sub directory ofasserts
And I move the
example.tl
file inassets/templates/
directory to test the case a template is not directly inasserts
directoryI made the test on Windows, but unfortunately, I have no Linux or Mac environnement to test on them, i hope it works fine on all environnements
Have a nice day
F.