Skip to content
This repository was archived by the owner on May 18, 2026. It is now read-only.

Commit c3243f8

Browse files
committed
Add an add-dist command.
1 parent 01e4f75 commit c3243f8

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

main.lisp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ add Add a new project or add a project to a dist
7979
specified multiple times. If unspecified,
8080
adds to all dists
8181
82+
add-dist Add a new dist
83+
name The name of the dist to create
84+
--url url The canonical URL at which the dist resides
85+
8286
remove Remove a project from dists
8387
name The name of the project to remove
8488
-d --dist dist The dist to remove the project from. Can be
@@ -219,6 +223,15 @@ Projects:~12t~{~a ~a~^~%~12t~}~%"
219223
(add-project project dist))
220224
(main-persist)))
221225

226+
(defun main/add-dist (name &key url)
227+
(let ((name (intern (string-upcase name) #.*package*)))
228+
(when (dist name)
229+
(error "A dist with this name already exists."))
230+
(when (or (null url) (string= "" url))
231+
(error "A canonical dist URL is required."))
232+
(setf (dist name) (make-instance 'dist :name name :url url)))
233+
(main-persist))
234+
222235
(defun main/remove (name &key dist)
223236
(let ((project (or (project name)
224237
(error "No project named ~s" name))))

0 commit comments

Comments
 (0)