Skip to content

Commit

Permalink
Install dependencies for package-lint-main-file
Browse files Browse the repository at this point in the history
Would fix #28
  • Loading branch information
leotaku committed Jun 20, 2024
1 parent 72ebb84 commit 6a1fc6b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions elisp-check.el
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,11 @@ documentation on the usage of PREFIX and KNOWN-BUFFERS."
(elisp-check--install-packages (elisp-check--get-props check :package)))

(defun elisp-check--install-package-requires (&rest _other)
"Install packages for Package-Requires for current buffer."
(let ((pkgs (elisp-check--get-package-requires)))
(elisp-check--install-packages pkgs)))
"Install packages for `package-lint-main-file' or current buffer."
(let ((file (or (bound-and-true-p package-lint-main-file) (buffer-file-name))))
(with-current-buffer (find-file-noselect file)
(let ((pkgs (elisp-check--get-package-requires)))
(elisp-check--install-packages pkgs)))))

(defun elisp-check--get-package-requires ()
"Get list of packages for Package-Requires for current buffer."
Expand Down

0 comments on commit 6a1fc6b

Please sign in to comment.