]> gitweb.factorcode.org Git - factor.git/commitdiff
tldr: download before memoizing index
authorJohn Benediktsson <mrjbq7@gmail.com>
Sat, 21 Jan 2023 00:05:05 +0000 (16:05 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Sat, 21 Jan 2023 00:05:05 +0000 (16:05 -0800)
extra/tldr/tldr.factor

index 9e1ff040b86e6b6157bb98b6931e993401c91b19..fce51b8fb8fa767aeda76e910a6d0aca59c0491a 100644 (file)
@@ -34,7 +34,7 @@ CONSTANT: tldr-zip URL" https://tldr-pages.github.io/assets/tldr.zip"
     "tldr/tldr.zip" cache-file file-exists? [ download-tldr ] unless ;
 
 MEMO: tldr-index ( -- index )
-    "tldr/index.json" cache-file path>json ;
+    ?download-tldr "tldr/index.json" cache-file path>json ;
 
 : find-command ( name -- command )
     tldr-index "commands" of [ "name" of = ] with find nip ;