load user config, make install and uninstall

This commit is contained in:
2026-07-05 23:00:30 +03:00
parent c00d9947b7
commit 9e7ad2f884
5 changed files with 39 additions and 15 deletions
+2 -6
View File
@@ -70,13 +70,9 @@
(if (null (root argument))
(uiop:ensure-directory-pathname (name argument))
(uiop:ensure-directory-pathname (root argument))))
(when (null (author argument))
(setf (author argument) lspack:*default-author*))
(let ((license (license argument)))
(when (stringp (license argument))
(setf (license argument)
(cond ((null license) lspack:*default-license*)
((stringp license) (intern (string-upcase license) :keyword))
(t lspack:*default-license*))))
(intern (string-upcase (license argument)) :keyword)))
argument)
(defun main ()
+14 -5
View File
@@ -117,14 +117,23 @@
(project-ensure-source-directory project)
(project-create-package project))
(defun start (name project-root &key (author *default-author*) (description "") (license *default-license*))
"Intended to be called interactively by the user at the repl"
(defun load-config ()
(let ((*package* (find-package :lspack))
(config (uiop:xdg-config-home "lspack/config.lisp")))
(format *error-output* "~&Loading ~S..." config)
(finish-output *error-output*)
(if (null (load config :if-does-not-exist nil))
(format *error-output* " failed~%" config)
(format *error-output* " ok~%" config))))
(defun start (name project-root &key author (description "") license)
"Creates commonly used files for a Common Lisp project from given arguments and loaded configuration. Can be called interactively by the user at the repl."
(load-config)
(let ((project (make-instance
'<project>
:project-root (uiop:ensure-directory-pathname project-root)
:project-name name
:project-author author
:project-author (or author *default-author*)
:project-description description
:project-license license)))
:project-license (or license *default-license*))))
(project-start project)))