From 771241cb1d10c7431113098496f6efcff09fbda3 Mon Sep 17 00:00:00 2001 From: Jaidyn Ann <10477760+JadedCtrl@users.noreply.github.com> Date: Fri, 31 May 2024 12:11:31 -0500 Subject: [PATCH] Fix URLs not getting substituted after download MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit That is, on the first run of MIRROR-IMG, no mirrored URLs got substituted — and on subsequent runs, only previously-downloaded URLS did. --- src/mirror-img.lisp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mirror-img.lisp b/src/mirror-img.lisp index 8dcd91c..2d1094b 100644 --- a/src/mirror-img.lisp +++ b/src/mirror-img.lisp @@ -139,8 +139,9 @@ already set)." (defun http-fetch (url path) "Download a URL to a path; if successful, returns the pathname. Otherwise, NIL." (handler-case - (and (dexador:fetch (url-encode-uri url) path) - (pathname path)) + ; DEXADOR:FETCH returns nil on success, errors on fail. Hence the OR. + (or (dexador:fetch (url-encode-uri url) path) + (pathname path)) (cl-user::file-exists () path) (error nil)))