I have no trouble starting my meteor server from the terminal window. But surely I can do this from a shell script that I make with Automator. This is what I do in the terminal window:

cd myAppName
meteor

For the the automator shell script, I change the directory differently:

cd /Users/myName/myAppName

... and that seems to work fine. But the next line gives a "meteor --command not found" message. I read somewhere that the shell that automator runs doesn't have access to the Environment variables that the terminal window uses. That must be the problem. So how do I run meteor from the shell script?

有帮助吗?

解决方案

Try setting the PATH variable from inside your script. It should include the directory path to your meteor executable.

It should be something like:

export PATH=$PATH:/opt/meteor/bin/meteor

After that meteor should launch. If meteor starts launching but it fails then you're missing more environment variables inside your script and you must export them as you did with the PATH.

To know which environment variables you have in your shell type this:

set
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top