Skip to content

Commit

Permalink
fix: Use different chars for synthetic paths. (#208)
Browse files Browse the repository at this point in the history
this fixes --exec, --tla-str and --ext-str on windows as < and > are
illegal file name characters.

fixes #200
  • Loading branch information
cfraenkel authored Nov 5, 2024
1 parent 6939b1a commit 9e975e9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sjsonnet/src-jvm-native/sjsonnet/SjsonnetMain.scala
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ object SjsonnetMain {
std: Val.Obj = new Std().Std): Either[String, String] = {

val (jsonnetCode, path) =
if (config.exec.value) (file, wd / "<exec>")
if (config.exec.value) (file, wd / "\uFE64exec\uFE65")
else {
val p = os.Path(file, wd)
(os.read(p), p)
Expand Down
2 changes: 1 addition & 1 deletion sjsonnet/src/sjsonnet/Interpreter.scala
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class Interpreter(extVars: Map[String, String],


def parseVar(k: String, v: String) = {
resolver.parse(wd / s"<$k>", StaticResolvedFile(v))(evaluator).fold(throw _, _._1)
resolver.parse(wd / s"\uFE64$k\uFE65", StaticResolvedFile(v))(evaluator).fold(throw _, _._1)
}

lazy val evaluator: Evaluator = createEvaluator(
Expand Down

0 comments on commit 9e975e9

Please sign in to comment.