From e92f085b04beb899643b7911a44d96b29ee4542e Mon Sep 17 00:00:00 2001 From: Dimitri Fontaine Date: Fri, 24 Jan 2014 15:10:45 +0100 Subject: [PATCH] Convert --root-dir to its truename before processing it, and manage errors to do so. --- src/main.lisp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main.lisp b/src/main.lisp index 356c548..dba47b9 100644 --- a/src/main.lisp +++ b/src/main.lisp @@ -108,8 +108,12 @@ ;; First care about the root directory where pgloader is supposed to ;; output its data logs and reject files - (setf *root-dir* (fad:pathname-as-directory root-dir)) - (mkdir-or-die *root-dir* debug) + (let ((root-dir-truename (probe-file root-dir))) + (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 (init-params-from-environment)