]> gitweb.factorcode.org Git - factor.git/commitdiff
gemini.cli: run less only if file exists.
authorJohn Benediktsson <mrjbq7@gmail.com>
Sun, 14 Mar 2021 04:50:41 +0000 (20:50 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Sun, 14 Mar 2021 04:50:41 +0000 (20:50 -0800)
extra/gemini/cli/cli.factor

index 3b8e63dc28661a9b7692553891c500d65e1218b6..d54f28ebd04758073e069a6c9f83541a943b24d8 100644 (file)
@@ -92,7 +92,9 @@ CONSTANT: URL V{ }
     ] when* ;
 
 : gemini-less ( -- )
-    "less" "gemini.txt" temp-file 2array try-process ;
+    "gemini.txt" temp-file dup exists? [
+        "less" swap 2array try-process
+    ] [ drop ] if ;
 
 : gemini-quit ( -- )
     "gemini.txt" temp-file ?delete-file 0 exit ;