Hubot - load environmental variables from a file

倾然丶 夕夏残阳落幕 提交于 2019-12-10 10:52:56

问题


setting environmental variables for a Hubot is pretty easy on the production server. However when I want to test the bot locally, I need the env vars inside a file. I already have the file .env for env vars that heroku is using for running locally.

But I can't seem to find a way to load env vars inside the Hubot scripts from a file.

Merry Christmas :-)


回答1:


okay it's possible with hubot-env.

https://www.npmjs.com/package/hubot-env

The following command will load the file from a relative path:

hubot env load --filename=[filename].

It previously didn't work for me because I had HUBOT_ENV_BASE_PATH set on my mac so the command searched in the wrong folder for the file.



来源:https://stackoverflow.com/questions/34453695/hubot-load-environmental-variables-from-a-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!