changelog shortlog graph tags branches files raw help

Mercurial > core / changeset: fixes

changeset 522: d8a8a13a5cce
parent 521: d1f96f95a10c
child 523: 04d0a4f857f6
author: Richard Westhaver <ellis@rwest.io>
date: Sun, 07 Jul 2024 14:50:09 -0400
files: lisp/lib/skel/core/obj.lisp lisp/lib/skel/core/types.lisp lisp/lib/skel/core/util.lisp
description: fixes
     1.1--- a/lisp/lib/skel/core/obj.lisp	Sun Jul 07 02:14:24 2024 -0400
     1.2+++ b/lisp/lib/skel/core/obj.lisp	Sun Jul 07 14:50:09 2024 -0400
     1.3@@ -129,13 +129,10 @@
     1.4    (stash :initform *skel-stash* :initarg :stash :type pathname :accessor sk-stash)
     1.5    (cache :initform *skel-cache* :initarg :cache :type pathname :accessor sk-cache)
     1.6    (registry :initform *skel-registry* :initarg :registry :type pathname :accessor sk-registry)
     1.7-   (scripts :initarg :scripts :type (or pathname list (vector pathname)) :accessor sk-scripts)
     1.8-   (license :initarg :license :type license-designator :accessor sk-license)
     1.9-   (log-level :initarg :log-level :type log-level-designator)
    1.10+   (scripts :initform nil :initarg :scripts :type (or pathname list (vector pathname)) :accessor sk-scripts)
    1.11+   (license :initform nil :initarg :license :type license-designator :accessor sk-license)
    1.12+   (log-level :initform *log-level* :initarg :log-level :type log-level-designator)
    1.13    (fmt :initform :pretty :initarg :fmt :type symbol)
    1.14-   (alias-list :initarg :alias-list
    1.15-               :type (or list vector)
    1.16-               :documentation "alist of aliases. currently used as a special cli-opt-parser by the skel binary.")
    1.17    (auto-insert :initform nil :initarg :auto-insert :type form))
    1.18   (:documentation "Root configuration class for the SKEL system. This class doesn't need to be exposed externally, but specifies all shared fields of SK-*-CONFIG types."))
    1.19 
     2.1--- a/lisp/lib/skel/core/types.lisp	Sun Jul 07 02:14:24 2024 -0400
     2.2+++ b/lisp/lib/skel/core/types.lisp	Sun Jul 07 14:50:09 2024 -0400
     2.3@@ -3,7 +3,7 @@
     2.4 (deftype vc-designator () `(member :hg :git list))
     2.5 
     2.6 ;; ref: https://spdx.org/licenses/
     2.7-(deftype license-designator () `(or string pathname (member :mpl2 :wtfpl :lgpg :llgpl :gpl :mit :mit0)))
     2.8+(deftype license-designator () `(or null string pathname (member :mpl2 :wtfpl :lgpg :llgpl :gpl :mit :mit0)))
     2.9 
    2.10 (deftype script-designator () '(member :bin :sh :bash :zsh :nu :lisp :python))
    2.11 
     3.1--- a/lisp/lib/skel/core/util.lisp	Sun Jul 07 02:14:24 2024 -0400
     3.2+++ b/lisp/lib/skel/core/util.lisp	Sun Jul 07 14:50:09 2024 -0400
     3.3@@ -116,15 +116,15 @@
     3.4   "Open the current system configuration using ED."
     3.5   (ed *system-skelrc*))
     3.6 
     3.7-(defun get-skelrc-slot* (slot)
     3.8+(defun get-skelrc-slot* (slot &optional (default (skel-simple-error "slot is unbound in skel config")))
     3.9   "First check *SKEL-USER-CONFIG* for a slot value, and if a valid value
    3.10 isn't found check *SKEL-SYSTEM-CONFIG*."
    3.11   (let ((slot (find-symbol (string-upcase (string slot)) :skel/core/obj)))
    3.12-    (if (not (slot-boundp *skel-user-config* slot))
    3.13-        (if (not (slot-boundp *skel-system-config* slot))
    3.14-            (skel-simple-error (format nil "slot is unbound: ~a" slot))
    3.15-            (slot-value *skel-system-config* slot)))
    3.16-    (slot-value *skel-user-config* slot)))
    3.17+    (if (or (null *skel-user-config*) (not (slot-boundp *skel-user-config* slot)))
    3.18+        (if (or (null *skel-system-config*) (not (slot-boundp *skel-system-config* slot)))
    3.19+            default
    3.20+            (slot-value *skel-system-config* slot))
    3.21+        (slot-value *skel-user-config* slot))))
    3.22 
    3.23 (defun init-skel-vars ()
    3.24   "Initialize the global SKEL variables:
    3.25@@ -140,10 +140,15 @@
    3.26   (load-skelrc)
    3.27   (when-let ((project (find-skelfile *default-pathname-defaults*)))
    3.28     (setq *skel-project* (load-skelfile project)))
    3.29-  (setq *skel-cache* (get-skelrc-slot* :cache)
    3.30-        *skel-store* (get-skelrc-slot* :store)
    3.31-        *skel-stash* (get-skelrc-slot* :stash)
    3.32-        *skel-registry* (get-skelrc-slot* :registry))
    3.33+  (when-let ((cache (get-skelrc-slot* :cache nil)))
    3.34+    (setq *skel-cache* cache))
    3.35+
    3.36+  (when-let ((store (get-skelrc-slot* :store nil)))
    3.37+    (setq *skel-store* store))
    3.38+  (when-let ((stash (get-skelrc-slot* :stash nil)))
    3.39+    (setq *skel-stash* stash))
    3.40+  (when-let ((registry (get-skelrc-slot* :registry nil)))
    3.41+    (setq *skel-registry* registry))
    3.42   (values))
    3.43 
    3.44 ;;; Paths