mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-15 11:02:36 +02:00
fixbug: linux环境变量key不能使用-
This commit is contained in:
parent
125f6be1b2
commit
46bce295ca
2 changed files with 6 additions and 2 deletions
|
|
@ -31,6 +31,10 @@ async def default_get_env(key: str, app_name: str = None) -> str:
|
|||
if app_key in os.environ:
|
||||
return os.environ[app_key]
|
||||
|
||||
env_app_key = app_key.replace("-", "_") # "-" is not supported by linux environment variable
|
||||
if env_app_key in os.environ:
|
||||
return os.environ[env_app_key]
|
||||
|
||||
from metagpt.context import Context
|
||||
|
||||
context = Context()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue