Merge pull request #180 from guicho271828/coleslaw-conf-uiop

Simplify the setting of COLESLAW-CONF:*BASEDIR*
This commit is contained in:
Masataro Asai 2019-10-27 15:44:42 -04:00 committed by GitHub
commit 4ab837508b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 27 deletions

View file

@ -1,12 +0,0 @@
(in-package #:asdf-user)
(defsystem #:coleslaw-conf
:name "coleslaw-conf"
:description "Configuration variable for Coleslaw, Flexible Lisp Blogware"
:version "0.9.7"
:license "BSD"
:author "Brit Butler <redline6561@gmail.com>"
:pathname "src/"
:depends-on ()
:serial t
:components ((:file "coleslaw-conf")))

View file

@ -7,8 +7,7 @@
:license "BSD" :license "BSD"
:author "Brit Butler <redline6561@gmail.com>" :author "Brit Butler <redline6561@gmail.com>"
:pathname "src/" :pathname "src/"
:depends-on (:coleslaw-conf :depends-on (:closure-template
:closure-template
:3bmd :3bmd
:3bmd-ext-code-blocks :3bmd-ext-code-blocks
:alexandria :alexandria
@ -17,9 +16,11 @@
:cl-fad :cl-fad
:cl-ppcre :cl-ppcre
:closer-mop :closer-mop
:cl-unicode) :cl-unicode
:uiop)
:serial t :serial t
:components ((:file "packages") :components ((:file "coleslaw-conf")
(:file "packages")
(:file "util") (:file "util")
(:file "config") (:file "config")
(:file "themes") (:file "themes")
@ -30,7 +31,3 @@
(:file "feeds") (:file "feeds")
(:file "coleslaw")) (:file "coleslaw"))
:in-order-to ((test-op (test-op coleslaw-test)))) :in-order-to ((test-op (test-op coleslaw-test))))
(defmethod perform :before ((op load-op)
(system (eql (find-system :coleslaw))))
(uiop:symbol-call "COLESLAW-CONF" 'set-basedir #.*load-truename*))

View file

@ -1,12 +1,10 @@
(defpackage #:coleslaw-conf (defpackage #:coleslaw-conf
(:use #:cl) (:use #:cl)
(:export #:*basedir* (:export #:*basedir*))
#:set-basedir))
(in-package #:coleslaw-conf) (in-package #:coleslaw-conf)
(defvar *basedir*) (defparameter *basedir*
(uiop/pathname:pathname-parent-directory-pathname
(defun set-basedir (pathname) #.(or *compile-file-truename* *load-truename*))
(setf coleslaw-conf:*basedir* "A pathname pointing to Coleslaw's top level directory.")
(make-pathname :name nil :type nil :defaults pathname)))