You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When the temp dir is set to a path that starts with a reserved word (/var/folders/... which is the default on OSX) the template compilation step fails with an exception similar to:
org.fusesource.scalate.CompilerException: Compilation failed:
:2.9 identifier expected but 'var' found.
package var.folders....
^
at app//org.fusesource.scalate.TemplateEngine.compileAndLoad(TemplateEngine.scala:857)
at app//org.fusesource.scalate.TemplateEngine.compileAndLoadEntry(TemplateEngine.scala:725)
at app//org.fusesource.scalate.TemplateEngine.liftedTree1$1(TemplateEngine.scala:436)
at app//org.fusesource.scalate.TemplateEngine.load(TemplateEngine.scala:430)
at app//org.fusesource.scalate.TemplateEngine.load(TemplateEngine.scala:485)
at app//org.fusesource.scalate.TemplateEngine.layout(TemplateEngine.scala:582)
...
To Reproduce
Can be reproduced using the following code:
val engine = new TemplateEngine
val source = TemplateSource.fromFile("/var/tmp2/foo.ssp")
source.engine = engine
assertResult("tmp2") { source.packageName } // will be "var.tmp2" instead
Expected behavior
The compilation of the template should not fail.
Desktop (please complete the following information):
OS: Mac OSX
This seems to be caused by an off by one error in extractPackageAndClassNames method of TemplateSource trait.
Will submit a PR.
The text was updated successfully, but these errors were encountered:
mvitaly
added a commit
to mvitaly/scalate
that referenced
this issue
Aug 1, 2023
Describe the bug
When the temp dir is set to a path that starts with a reserved word (
/var/folders/...
which is the default on OSX) the template compilation step fails with an exception similar to:To Reproduce
Can be reproduced using the following code:
Expected behavior
The compilation of the template should not fail.
Desktop (please complete the following information):
This seems to be caused by an off by one error in
extractPackageAndClassNames
method ofTemplateSource
trait.Will submit a PR.
The text was updated successfully, but these errors were encountered: