mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-03 12:27:26 -05:00
Fix permission-error on +pretty-code/install-patched-font #2807
This commit is contained in:
@ -59,15 +59,15 @@ which is expanded for each font in FONTS-ALIST. FONTS-ALIST should be the
|
||||
filename of each font. It is used as the source and destination filename."
|
||||
(or prefix
|
||||
(yes-or-no-p
|
||||
(format "This will download and install the %s fonts, are you
|
||||
sure you want to do this?" name))
|
||||
(format "This will download and install the %s fonts, are you sure you want to do this?"
|
||||
name))
|
||||
(user-error "Aborted"))
|
||||
(let* ((font-dest
|
||||
(pcase window-system
|
||||
(`x
|
||||
(expand-file-name
|
||||
"/fonts/" (or (getenv "XDG_DATA_HOME")
|
||||
(concat (getenv "HOME") "/.local/share"))))
|
||||
"fonts/" (or (getenv "XDG_DATA_HOME")
|
||||
"~/.local/share")))
|
||||
((or `mac `ns)
|
||||
(expand-file-name "~/Library/Fonts/"))))
|
||||
(known-dest? (stringp font-dest))
|
||||
@ -80,11 +80,10 @@ sure you want to do this?" name))
|
||||
t))
|
||||
(when known-dest?
|
||||
(message "Font downloaded, updating font cache... <fc-cache -f -v> ")
|
||||
(shell-command-to-string (format "fc-cache -f -v")))
|
||||
(shell-command-to-string "fc-cache -f -v"))
|
||||
(message "Successfully %s `%s' fonts to `%s'!%s"
|
||||
(if known-dest? "installed" "downloaded")
|
||||
name
|
||||
font-dest)))
|
||||
name font-dest)))
|
||||
|
||||
;;;###autoload
|
||||
(defun +pretty-code/install-patched-font (font-name &optional prefix)
|
||||
|
Reference in New Issue
Block a user