Skip to content

Commit 098d292

Browse files
committed
ensure existing directory
I forget every freaking time. Good place to add a transient wizard ^_^ Signed-off-by: Psionik K <73710933+psionic-k@users.noreply.github.com>
1 parent 17ca143 commit 098d292

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

lisp/erk.el

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -757,8 +757,16 @@ implementation information and more details about argument usage."
757757
"Rev, tag, or branch (empty implies default branch): "))
758758
(template (plist-put template :rev rev))
759759
(clone-root
760-
(directory-file-name
761-
(read-directory-name "Clone root: " default-directory)))
760+
(let ((root))
761+
(while (not root)
762+
(let ((candidate
763+
(directory-file-name
764+
(read-directory-name "Clone root (must exist): " default-directory))))
765+
(if (file-directory-p candidate)
766+
(setq root candidate)
767+
(message "Directory must exist!")
768+
(sit-for 1))))
769+
root))
762770
(title
763771
(read-string
764772
"Package full name, for documentation: "

0 commit comments

Comments
 (0)