Fix URLs not getting substituted after download

That is, on the first run of MIRROR-IMG, no
mirrored URLs got substituted — and on subsequent
runs, only previously-downloaded URLS did.
This commit is contained in:
Jaidyn Ann 2024-05-31 12:11:31 -05:00
parent 06890e2395
commit 771241cb1d

View File

@ -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)))