[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/projectile 6141587 1/4: [Fix #1703] Improve projectile-gen
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/projectile 6141587 1/4: [Fix #1703] Improve projectile-generic-command default (#1706) |
Date: |
Sun, 5 Sep 2021 02:57:36 -0400 (EDT) |
branch: elpa/projectile
commit 614158792948f77accc1c1e998bb0a8fde0ab98f
Author: Victor Makarov <vitja.makarov@gmail.com>
Commit: GitHub <noreply@github.com>
[Fix #1703] Improve projectile-generic-command default (#1706)
* Use fd/fdfind when available
* Strip leading ./ from paths produced by find
---
projectile.el | 8 +++++---
test/projectile-test.el | 2 +-
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/projectile.el b/projectile.el
index de881a5..235a6e2 100644
--- a/projectile.el
+++ b/projectile.el
@@ -690,9 +690,11 @@ Set to nil to disable listing submodules contents."
:type 'string)
(defcustom projectile-generic-command
- (if (executable-find "fd")
- "fd . -0 --type f --color=never"
- "find . -type f -print0")
+ (cond ((executable-find "fd")
+ "fd . -0 --type f --color=never")
+ ((executable-find "fdfind")
+ "fdfind . -0 --type f --color=never")
+ (t "find . -type f | cut -c3- | tr '\\n' '\\0'"))
"Command used by projectile to get the files in a generic project."
:group 'projectile
:type 'string)
diff --git a/test/projectile-test.el b/test/projectile-test.el
index 8f2c84c..3d37dd6 100644
--- a/test/projectile-test.el
+++ b/test/projectile-test.el
@@ -747,7 +747,7 @@ Just delegates OPERATION and ARGS for all operations except
for`shell-command`'.
;; After listing all the files, the cache should have been updated.
(projectile-current-project-files)
;; find returns the leading ./ therefore the somewhat odd notation here
- (dolist (f '("./file1.el" "./file2.el"))
+ (dolist (f '("file1.el" "file2.el"))
(expect (member f (gethash (projectile-project-root)
projectile-projects-cache)) :to-be-truthy))))))
(it "ensures that we don't cache a project root if the path has changed."
(projectile-test-with-sandbox