Commit aaf0f5be authored by Antoine Martin's avatar Antoine Martin
Browse files

Add security to check if file exists

parent d096bd7b
......@@ -98,16 +98,16 @@ The resulting file is written at ~/quickref/index.html"
(format file "</body>~%")))
(defun build-texi (texi)
(let ((texi-name (pathname-name texi)))
(format t "Generating html file for ~A" texi-name)
(let* ((texi-name (pathname-name texi))
(html-path (from-quickref-dir
(format nil "website/~A.html" texi-name))))
(format t "Generating html file for ~A~%" texi-name)
(let ((out (with-output-to-string (out)
(sb-ext:run-program
*makeinfo-path*
(nconc
(list "--html" (namestring texi)
"-o" (namestring
(from-quickref-dir
(format nil "website/~A.html" texi-name)))
"-o" (namestring html-path)
"--css-ref" "/document.css"
"-c" "TOP_NODE_UP_URL=/"
"--no-split")
......@@ -119,14 +119,13 @@ The resulting file is written at ~/quickref/index.html"
(if *log-errors*
(log-texi-error out texi)
(format t out))))
;; Add README in Introduction if we find one
(let ((readme-path (find-readme texi-name)))
(when readme-path
(format t " with README")
(use-readme-intro
(from-quickref-dir (format nil "website/~A.html" texi-name))
readme-path))))
(format t "~%"))
;; Check if file was created properly
(when (probe-file html-path)
;; Add README in Introduction if we find one
(let ((readme-path (find-readme texi-name)))
(when readme-path
(format t "Adding README to ~A.html~%" texi-name)
(use-readme-intro html-path readme-path))))))
(defun build-texis (&key (makeinfo-path *makeinfo-path*) (log-errors *log-errors*))
"Calls makeinfo on each .texi file, places the resulting html files in ~/quickref/"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment