Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

* helm-locate.el (helm-locate-1): Prevent user trying to create a db …

…with a dir.
  • Loading branch information...
commit b15efd8c8b03d7f0445531181c8b53b6225998f3 1 parent 142ec56
Thierry Volpiatto thierryvolpiatto authored
Showing with 11 additions and 9 deletions.
  1. +11 −9 helm-locate.el
20 helm-locate.el
View
@@ -117,20 +117,22 @@ See `helm-locate-with-db' and `helm-locate'."
(and localdb
(or (helm-ff-find-locatedb from-ff)
(helm-c-read-file-name
- "Choose or create Locate Db file: "
+ "Choose or create Locate Db file (locate.db) : "
:initial-input (or helm-ff-default-directory
default-directory)
:marked-candidates t
:preselect helm-locate-db-file-regexp
:persistent-action #'(lambda (candidate)
- (shell-command
- (format helm-locate-create-db-command
- candidate
- helm-ff-default-directory))
- (helm-force-update
- (if helm-ff-transformer-show-only-basename
- (helm-c-basename candidate)
- candidate)))
+ (if (file-directory-p candidate)
+ (message "Error: The locate Db should be a file")
+ (shell-command
+ (format helm-locate-create-db-command
+ candidate
+ helm-ff-default-directory))
+ (helm-force-update
+ (if helm-ff-transformer-show-only-basename
+ (helm-c-basename candidate)
+ candidate))))
:must-match t
:persistent-help "Create locale locate Db"
:test #'(lambda (x)
Please sign in to comment.
Something went wrong with that request. Please try again.