mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-03 12:27:26 -05:00
fix(lib): doom/sudo-find-file: expand given path
It's possible for the user to type shell variables (something like `$MYVAR/dir/filename`) as part of the filepath, so we need to call `expand-file-name`.
This commit is contained in:
@ -487,7 +487,7 @@ If FORCE-P, overwrite the destination file if it exists, without confirmation."
|
|||||||
(defun doom/sudo-find-file (file)
|
(defun doom/sudo-find-file (file)
|
||||||
"Open FILE as root."
|
"Open FILE as root."
|
||||||
(interactive "FOpen file as root: ")
|
(interactive "FOpen file as root: ")
|
||||||
(find-file (doom--sudo-file-path file)))
|
(find-file (doom--sudo-file-path (expand-file-name file))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom/sudo-this-file ()
|
(defun doom/sudo-this-file ()
|
||||||
|
Reference in New Issue
Block a user