I've removed these CLI properties because they were either unused (:deprecated and :since) or poorly implemented (:stub and :obsolete). And I'd rather have fewer magical properties, and instead delegate these roles to the defobsolete! and (new) defstub! macros. Also, in the future, the help API will ascertain :since dynamically, so it won't be very useful. In summary: - Use defstub! instead of :stub - Use defobsolete! instead of :obsolete or :deprecated - This removes the doom-cli-deprecated-error type (it's not really an error to begin with). - Removes :stub, :obsolete, :deprecated, and :since
63 lines
1.7 KiB
EmacsLisp
63 lines
1.7 KiB
EmacsLisp
;;; core/cli/make.el --- file generation commands -*- lexical-binding: t; -*-
|
|
;;; Commentary:
|
|
;;; Code:
|
|
|
|
(load! "make/completions")
|
|
;; (load! "make/docs")
|
|
;; (load! "make/manpage")
|
|
|
|
|
|
;;
|
|
;;; Variables
|
|
|
|
;; (defvar doom-make-codeowners ()
|
|
;; "TODO")
|
|
|
|
|
|
;;
|
|
;;; Commands
|
|
|
|
(defcli! make ()
|
|
"(Re)Generate project files and boilerplate."
|
|
:partial t)
|
|
|
|
;; TODO Finish and generalize me
|
|
(defstub! (make codeowners) ()
|
|
"TODO"
|
|
(print! (start "Generating CODEOWNERS file"))
|
|
(let ((codeowners (doom-path doom-emacs-dir ".github/CODEOWNERS")))
|
|
(with-temp-file codeowners
|
|
(insert-file-contents codeowners)
|
|
(when (re-search-forward "^# Don't edit this by hand!" nil t)
|
|
(goto-char (line-end-position))
|
|
(delete-region (point) (point-max))
|
|
(insert "\n")
|
|
(dolist (path (cdr (doom-module-load-path (list doom-modules-dir))))
|
|
(when (string-match "/modules/\\([^/]+\\)/\\([^/]+\\)/$" path)
|
|
(insert (format "%-35s @doomemacs/maintainers @doomemacs/%s-%s\n"
|
|
(concat (substring (match-string-no-properties 0 path) 1) "*")
|
|
(match-string-no-properties 1 path)
|
|
(match-string-no-properties 2 path)))))))))
|
|
|
|
;; TODO Finish me
|
|
(defstub! (make changelog))
|
|
|
|
|
|
|
|
;;
|
|
;;; Helpers
|
|
|
|
(defmacro doom-make--with-file (file &rest body)
|
|
(declare (indent 1))
|
|
`(let ((inhibit-read-only t))
|
|
(with-current-buffer
|
|
(or (get-file-buffer ,file)
|
|
(find-file-noselect ,file))
|
|
(save-excursion
|
|
(goto-char (point-min))
|
|
,@body
|
|
(when (buffer-modified-p)
|
|
(save-buffer))))))
|
|
|
|
(provide 'core-cli-make)
|
|
;;; make.el ends here
|