From 9e975e9a95db52c17920d0e380c462cb910d7b52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Fr=C3=A4nkel?= Date: Tue, 5 Nov 2024 19:08:55 +0100 Subject: [PATCH] fix: Use different chars for synthetic paths. (#208) this fixes --exec, --tla-str and --ext-str on windows as < and > are illegal file name characters. fixes #200 --- sjsonnet/src-jvm-native/sjsonnet/SjsonnetMain.scala | 2 +- sjsonnet/src/sjsonnet/Interpreter.scala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sjsonnet/src-jvm-native/sjsonnet/SjsonnetMain.scala b/sjsonnet/src-jvm-native/sjsonnet/SjsonnetMain.scala index 6a59856a..1ea9989c 100644 --- a/sjsonnet/src-jvm-native/sjsonnet/SjsonnetMain.scala +++ b/sjsonnet/src-jvm-native/sjsonnet/SjsonnetMain.scala @@ -179,7 +179,7 @@ object SjsonnetMain { std: Val.Obj = new Std().Std): Either[String, String] = { val (jsonnetCode, path) = - if (config.exec.value) (file, wd / "") + if (config.exec.value) (file, wd / "\uFE64exec\uFE65") else { val p = os.Path(file, wd) (os.read(p), p) diff --git a/sjsonnet/src/sjsonnet/Interpreter.scala b/sjsonnet/src/sjsonnet/Interpreter.scala index 3de38fa6..b82ed5dc 100644 --- a/sjsonnet/src/sjsonnet/Interpreter.scala +++ b/sjsonnet/src/sjsonnet/Interpreter.scala @@ -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(