From ea88ae1a5b35a7d6e050f48b782abab81dea02d4 Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Mon, 8 Jul 2019 21:45:51 -0400 Subject: [PATCH] Use paths in cache for jpm that will work on windows. --- auxlib/cook.janet | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/auxlib/cook.janet b/auxlib/cook.janet index 5490f8d3..cac8d73c 100644 --- a/auxlib/cook.janet +++ b/auxlib/cook.janet @@ -296,10 +296,14 @@ # Public utilities # +(def- filepath-replacer + "Convert url with potential bad characters into a file path element." + (peg/compile ~(% (+ (/ '(set "<>:\"/\\|?*") "_") '1)))) + (defn repo-id "Convert a repo url into a path component that serves as its id." [repo] - (string/replace-all "\\" "_" (string/replace-all "/" "_" repo))) + (get (peg/match filepath-replacer repo) 0)) (defn find-manifest-dir "Get the path to the directory containing manifests for installed