Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions gptel-context.el
Original file line number Diff line number Diff line change
Expand Up @@ -253,11 +253,12 @@ ACTION should be either `add' or `remove'."
If PATH is a directory, recursively add all files in it. PATH should be
readable as text."
(interactive "fChoose file to add to context: ")
(cond ((file-directory-p path)
(gptel-context--add-directory path 'add))
((gptel--file-binary-p path)
(gptel-context--add-binary-file path))
(t (gptel-context--add-text-file path))))
(let ((path (expand-file-name path)))
(cond ((file-directory-p path)
(gptel-context--add-directory path 'add))
((gptel--file-binary-p path)
(gptel-context--add-binary-file path))
(t (gptel-context--add-text-file path)))))

;;;###autoload (autoload 'gptel-add-file "gptel-context" "Add files to gptel's context." t)
(defalias 'gptel-add-file #'gptel-context-add-file)
Expand Down