mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-03 12:27:26 -05:00
doom-directory-size: error if path doesn't exist
This commit is contained in:
@ -181,6 +181,8 @@ single file or nested compound statement of `and' and `or' statements."
|
|||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom-directory-size (dir)
|
(defun doom-directory-size (dir)
|
||||||
"Returns the size of FILE (in DIR) in kilobytes."
|
"Returns the size of FILE (in DIR) in kilobytes."
|
||||||
|
(unless (file-directory-p dir)
|
||||||
|
(error "Directory %S does not exist" dir))
|
||||||
(if (executable-find "du")
|
(if (executable-find "du")
|
||||||
(/ (string-to-number (cdr (doom-call-process "du" "-sb" dir)))
|
(/ (string-to-number (cdr (doom-call-process "du" "-sb" dir)))
|
||||||
1024.0)
|
1024.0)
|
||||||
|
Reference in New Issue
Block a user