Skip to content

Commit

Permalink
Remove only system
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 committed Nov 19, 2024
1 parent 50d6546 commit f110145
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 38 deletions.
6 changes: 0 additions & 6 deletions lisp/_prepare.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -490,12 +490,6 @@ to actually set up the systems."
(let ((path (car (cdr (qob-primary-system-entry)))))
(qob-file-name-directory path)))

(defun qob-only-system ()
"Return the default system if only one system is loaded in the workspace."
(qob-init-asds)
(when (= (length qob-loaded-asds) 1)
(qob-primary-system-entry)))

(defun qob-find-asd-file (name)
"Return the ASD file by system's NAME."
(let ((result))
Expand Down
24 changes: 12 additions & 12 deletions lisp/core/build.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,21 @@
(qob-start
(let* ((systems (qob-args))
(systems-len (length systems))
(default-name (qob-only-system)))
(primary-system (qob-primary-system-entry)))
(cond
;; If only specified one system.
(default-name
(qob-build--print-header 1)
(qob-build--system-by-name (car default-name))
(qob-build--print-footer))
;; If no system(s) specified.
((zerop systems-len)
(qob-help "core/build"))
;; Build system for all specify systems.
(t
;; If specified system(s).
(systems
(qob-build--print-header systems-len)
(dolist (name systems)
(qob-build--system-by-name name))
(qob-build--print-footer)))))
(qob-build--print-footer))
;; Print primary system.
(primary-system
(qob-build--print-header 1)
(qob-build--system-by-name (car primary-system))
(qob-build--print-footer))
;; Print help.
(t
(qob-help "core/build")))))

;;; End of lisp/core/build.lisp
20 changes: 10 additions & 10 deletions lisp/core/info.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,17 @@

(qob-start
(let ((names (qob-args))
(default-system (qob-only-system)))
(primary-system (qob-primary-system-entry)))
(cond
;; If only specified one system.
(default-system
(qob-info--print-system (car default-system)))
;; If no system(s) specified.
((zerop (length names))
(qob-help "core/info"))
;; Print all systems information.
(t
;; If specified system(s).
(names
(dolist (name names)
(qob-info--print-system name))))))
(qob-info--print-system name)))
;; Print primary system.
(primary-system
(qob-info--print-system (car primary-system)))
;; Print help.
(t
(qob-help "core/info")))))

;;; End of lisp/core/info.lisp
20 changes: 10 additions & 10 deletions lisp/core/install-deps.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,17 @@

(qob-start
(let ((systems (qob-args))
(default-name (qob-only-system)))
(primary-system (qob-primary-system-entry)))
(cond
;; If only specified one system.
(default-name
(qob-install-deps--by-system-name (car default-name)))
;; If no system(s) specified.
((zerop (length systems))
(qob-help "core/install-deps"))
;; Install depedencies for all specify systems.
(t
;; If specified system(s).
(systems
(dolist (system-name systems)
(qob-install-deps--by-system-name system-name))))))
(qob-install-deps--by-system-name system-name)))
;; Print primary system.
(primary-system
(qob-install-deps--by-system-name (car primary-system)))
;; Print help.
(t
(qob-help "core/install-deps")))))

;;; End of lisp/core/install-deps.lisp

0 comments on commit f110145

Please sign in to comment.