diff --git a/Makefile b/Makefile index 41e006f..bcca032 100644 --- a/Makefile +++ b/Makefile @@ -3,3 +3,11 @@ sbcl: ecl: ecl --norc --load build.lisp + +install: + cp lspack /usr/local/bin/ + cp doc/lspack.1 /usr/local/share/man/man1/ + +uninstall: + rm /usr/local/bin/lspack + rm /usr/local/share/man/man1/lspack.1 diff --git a/doc/todo.org b/doc/todo.org index ad4648e..59bb218 100644 --- a/doc/todo.org +++ b/doc/todo.org @@ -1,8 +1,19 @@ * v0.0.4 -- [ ] Load user config from $XDG_CONFIG_HOME/lspack/config.lisp -- [ ] Load licenses at compile time +- [X] Load user config from $XDG_CONFIG_HOME/lspack/config.lisp (v.0.0.6) +- [-] Load licenses at compile time - [X] SBCL (v0.0.5) - [ ] ECL -- [ ] Install exe, licenses, manpage +- [X] Install exe, manpage (v.0.0.6) + - installing licenses may not be needed if they will be compiled anyway - [X] Compile with ECL (v0.0.5) + +* v0.0.5 + +depending on user config + +- [ ] Create a README as either .md or .org +- [ ] Create exe and test defsystems +- [ ] Allow creation of project types with different default values + and behaviour + - [ ] Allow those types to :depends-on default libraries diff --git a/lspack.asd b/lspack.asd index 879c18c..de52c54 100644 --- a/lspack.asd +++ b/lspack.asd @@ -2,7 +2,7 @@ :author "Emre Akan" :description "Quickstart Common Lisp projects" :license "GPL-3.0" - :version "0.0.5" + :version "0.0.6" :depends-on ("uiop") :pathname "src/" :serial t diff --git a/src/main.lisp b/src/main.lisp index 3ea412a..e3690b9 100644 --- a/src/main.lisp +++ b/src/main.lisp @@ -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 () diff --git a/src/starter.lisp b/src/starter.lisp index ea7de6b..7cd221d 100644 --- a/src/starter.lisp +++ b/src/starter.lisp @@ -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-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))) -