I’m trying to make the RuboCop bundle work with the new callback.document.did-reload. However, it seems when a command is run from this callback, that TM_PROJECT_DIR is not set. Is this expected?
(I tried with and without filebrowser, and even after explicitly setting a project directory with “Use «folder» as Project Folder”).
Stefan
Hi Stefan,
On 30 Aug 2016, at 13:38 , Stefan Daschek stefan@daschek.net wrote:
I’m trying to make the RuboCop bundle work with the new callback.document.did-reload. However, it seems when a command is run from this callback, that TM_PROJECT_DIR is not set. Is this expected?
I think you want `TM_PROJECT_DIRECTORY` instead of `TM_PROJECT_DIR`. And yes, this variable might not be set [1]:
• TM_PROJECT_DIRECTORY — the top-level folder in the project drawer (may not be set).
[1]: https://manual.macromates.com/en/environment_variables.html
(I tried with and without filebrowser, and even after explicitly setting a project directory with “Use «folder» as Project Folder”).
Stefan
Kind regards, René
On 30 Aug 2016, at 13:38, Stefan Daschek wrote:
I’m trying to make the RuboCop bundle work with the new callback.document.did-reload. However, it seems when a command is run from this callback, that TM_PROJECT_DIR is not set. Is this expected?
Turns out all variables are missing for commands being run as part of a NSApplicationDidBecomeActiveNotification since at that time there is no main nor key window, so TextMate does not find the proper handler (via the responder chain) to supply the variables.
This will be fixed in next build.
FYI if you modify the file while TextMate is active, it should work.