Skip to content

Commit

Permalink
Add an add-dist command.
Browse files Browse the repository at this point in the history
  • Loading branch information
Shinmera committed Mar 14, 2024
1 parent 01e4f75 commit c3243f8
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions main.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ add Add a new project or add a project to a dist
specified multiple times. If unspecified,
adds to all dists
add-dist Add a new dist
name The name of the dist to create
--url url The canonical URL at which the dist resides
remove Remove a project from dists
name The name of the project to remove
-d --dist dist The dist to remove the project from. Can be
Expand Down Expand Up @@ -219,6 +223,15 @@ Projects:~12t~{~a ~a~^~%~12t~}~%"
(add-project project dist))
(main-persist)))

(defun main/add-dist (name &key url)
(let ((name (intern (string-upcase name) #.*package*)))
(when (dist name)
(error "A dist with this name already exists."))
(when (or (null url) (string= "" url))
(error "A canonical dist URL is required."))
(setf (dist name) (make-instance 'dist :name name :url url)))
(main-persist))

(defun main/remove (name &key dist)
(let ((project (or (project name)
(error "No project named ~s" name))))
Expand Down

0 comments on commit c3243f8

Please sign in to comment.