 the search will be rooted from DIR."
   (unless (file-directory-p dir)
     (error "Directory %S does not exist" dir))
-  (let* ((default-directory (file-truename (expand-file-name dir)))
-         (projectile-project-root
-          (or (projectile-project-root)
-              default-directory)))
+  (let ((default-directory (file-truename (expand-file-name dir)))
+        (projectile-project-root
+         (or (doom-project-root dir)
+             default-directory)))
     (call-interactively
      ;; Intentionally avoid `helm-projectile-find-file', because it runs
      ;; asynchronously, and thus doesn't see the lexical `default-directory'

;; Library

;;;###autoload
(defalias 'doom-project-p #'projectile-project-p)

;;;###autoload
(defalias 'doom-project-root #'projectile-project-root)

;;;###autoload
(defun doom-project-name (&optional dir)
  "Return the name of the current project."
  (let ((project-root (or (projectile-project-root dir)
                          (if dir (expand-file-name dir)))))
    (if project-root
        (funcall projectile-project-name-function project-root)
      "-")))

;;;###autoload
(defun doom-project-expand (name &optional dir)
  "Expand NAME to project root."
  (expand-file-name name (projectile-project-root dir)))

;;;###autoload
(defun doom-project-find-file (dir)

you want to interactive with a project other than the one you're in."
  `(let ((projectile-project-root-cache (make-hash-table :test 'equal))
         projectile-project-name
         projectile-project-root
         projectile-require-project-root)
     ,@body))

