ZachMassia / PlatformIO-Mode

PlatformIO Integration for Emacs
GNU General Public License v3.0
68 stars 20 forks source link

'Add' button in Boards menu triggers "not in a projectile-project" user-error #26

Open BrandonIrizarry opened 1 year ago

BrandonIrizarry commented 1 year ago

I've installed platformio-mode from MELPA. I notice that the Add button in the platformio-boards menu ultimately invokes this code:

(defun platformio--exec (target)
  "Call `platformio ... TARGET' in the root of the project."
  (let ((default-directory (projectile-project-root))
        (cmd (concat "platformio -f -c emacs " target)))
    (unless default-directory
      (user-error "Not in a projectile project, aborting"))
   ...

However, when in the *PlatformIO Boards* buffer, (projectile-project-root) is (understandably) nil, so the user-error is triggered, even when I've generated the menu from a file that's part of a Projectile project. For context, the default-directory (not to be confused with your local variable) is my home directory. I've tried using the menu both with M-x and from the Tools menu.