SilentVoid13 / Templater Public
generated from obsidianmd/obsidian-sample-pluginNew issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
User-defined functions break if tools installed with Homebrew are used #512
Comments
|
@christyray Please fill out the bug report template. |
|
@shabegom - I'm sorry for the confusion, but I thought I did? I updated it to add the rest of my settings and two of the functions I tried - is there anything else that would be helpful for me to add? |
|
@christyray hrm this is all I see right now... I'm not sure what's happening, maybe repost as a comment? |
|
@shabegom - that is odd! I pasted the text below, hopefully it works this time! Plugin information:
Describe the bug It appears to be specific to tools installed with Homebrew. I have other user functions that only use standard shell tools, and they work fine, but I've tried multiple Homebrew tools, and they all give the same error. Two of the functions that I tried were:
These both gave the Expected behavior Additional context |
|
Update: based on this issue with the Obsidian Git plugin, it looks like the problem is that the Based on the suggestions in that issue, I rewrote my user-defined function as a bash script with I'm not sure if this is fixable within the plugin since it seems to be a problem with Obsidian itself (although I could be totally off-base), but I'm not bothered by just writing separate scripts instead of directly pasting the code in Templater. |
|
Yeah I noticed that the $PATH being used when triggering templater is different from the $PATH defined in a .bashrc. Templater is using Node's |
|
It looks like If it was something you wanted to add in Templater, you could probably add a setting for the user to specify any additional search paths and then pass that to I made a small plugin for myself to add Since this isn't actually a bug with Templater, I can close this unless there's anything else that would be helpful to add! |
|
Great sleuthing. This problem comes up more than I would expect so we should either add the feature to Templater, fix it in obsidian, or point towards another solution. I'll close this, but if you choose to push your plugin to github let me know so I can link it as a workaround. |

Plugin informations (please complete the following information):
Describe the bug
When I create a user function that relies on a tool installed with Homebrew, I get the error
command not found. If I specify the path to the alias created by Homebrew (e.g.,/user/local/bin/toolname), I get the errorenv: node: No such file or directory.It appears to be specific to tools installed with Homebrew. I have other user functions that only use standard shell tools, and they work fine, but I've tried multiple Homebrew tools, and they all give the same error.
Two of the functions that I tried were:
curl -s https://api.weather.gov/gridpoints/LWX/109,90/forecast | /usr/local/bin/fx '.properties.periods[0].detailedForecast'-fxis a command-line tool I installed with Homebrew/usr/local/bin/tldr curl-tldris another command-line tool I installed with Homebrew (the expected output of the command is a plain-text summary of thecurldocumentation)These both gave the
env: node: No such file or directoryerror.Expected behavior
I expected the shell command to work inside Templater like it does when I execute it at the command line.
Additional context
It looks like I'm having the same issue that was described in this forum post, if that helps give more information!
The text was updated successfully, but these errors were encountered: