diff --git a/gptel-transient.el b/gptel-transient.el index 4fcfa1b..0f4dc57 100644 --- a/gptel-transient.el +++ b/gptel-transient.el @@ -78,11 +78,13 @@ which see." "?")) ;; Fetch file (message "Fetching prompts...") - (if (url-copy-file gptel--crowdsourced-prompts-url - gptel-crowdsourced-prompts-file - 'ok-if-already-exists) - (message "Fetching prompts... done.") - (message "Could not retrieve new prompts.")))) + (let ((dir (file-name-directory gptel-crowdsourced-prompts-file))) + (unless (file-exists-p dir) (mkdir dir 'create-parents)) + (if (url-copy-file gptel--crowdsourced-prompts-url + gptel-crowdsourced-prompts-file + 'ok-if-already-exists) + (message "Fetching prompts... done.") + (message "Could not retrieve new prompts."))))) (if (not (file-readable-p gptel-crowdsourced-prompts-file)) (progn (message "No crowdsourced prompts available") (call-interactively #'gptel-system-prompt))