Convert --root-dir to its truename before processing it, and manage errors to do so.

This commit is contained in:
Dimitri Fontaine 2014-01-24 15:10:45 +01:00
parent c50164e53d
commit e92f085b04

View File

@ -108,8 +108,12 @@
;; First care about the root directory where pgloader is supposed to ;; First care about the root directory where pgloader is supposed to
;; output its data logs and reject files ;; output its data logs and reject files
(setf *root-dir* (fad:pathname-as-directory root-dir)) (let ((root-dir-truename (probe-file root-dir)))
(mkdir-or-die *root-dir* debug) (if root-dir-truename
(progn
(setf *root-dir* (fad:pathname-as-directory root-dir-truename))
(mkdir-or-die *root-dir* debug))
(format t "FATAL: can't find root-dir: ~s~%" root-dir)))
;; Set parameters that come from the environement ;; Set parameters that come from the environement
(init-params-from-environment) (init-params-from-environment)