fix(cli): ci.el loader
- :before ci will try to load $REPOROOT/ci.el or $DOOMDIR/ci.el. It finds $REPOROOT by calling `git`, but doesn't handle errors. Now it does. - Because &rest was in :before ci's argspec, :before ci * subcommands would be inaccessible (not that any exist atm, though). - Let the user know when it finds the project's ci.el.
This commit is contained in:
parent
7862a9e15d
commit
50a0c2ef46
1 changed files with 8 additions and 5 deletions
|
@ -247,15 +247,18 @@ Note: warnings are not considered failures.")
|
|||
;;; Commands
|
||||
|
||||
;;; doom ci
|
||||
(defcli! (:before ci) (&rest _)
|
||||
(defcli! (:before ci) (&args _)
|
||||
(when-let*
|
||||
((repo-root (or (cdr (doom-call-process "git" "rev-parse" "--show-toplevel"))
|
||||
default-directory))
|
||||
((repo-root
|
||||
(if-let* ((result (sh! "git" "rev-parse" "--show-toplevel"))
|
||||
((zerop (car result))))
|
||||
(cdr result)
|
||||
default-directory))
|
||||
(local-config
|
||||
(car (or (doom-glob repo-root "ci.el")
|
||||
(doom-glob doom-private-dir "ci.el")))))
|
||||
(print! (item "Loading %s") (path local-config))
|
||||
(load local-config nil t t)))
|
||||
(load local-config nil t t)
|
||||
(print! (item "Loaded %S") local-config)))
|
||||
|
||||
(defcli! ci ()
|
||||
"Commands that automate development processes."
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue