Skip to content

Commit

Permalink
fix #114
Browse files Browse the repository at this point in the history
  • Loading branch information
lemisky committed Jun 12, 2023
1 parent 3c47a1d commit de122b0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/aligo/core/Auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,18 @@
from .EMail import send_email
from .LoginServer import LoginServer

# 默认配置目录
aligo_config_folder = Path.home().joinpath('.aligo')
aligo_config_folder.mkdir(parents=True, exist_ok=True)


def set_config_folder(path: str):
# fix https://github.com/foyoux/aligo/issues/114
global aligo_config_folder
aligo_config_folder = Path(path)
aligo_config_folder.mkdir(parents=True, exist_ok=True)


def get_configurations() -> List[str]:
"""获取配置文件列表"""
list_: List[str] = []
Expand Down
2 changes: 1 addition & 1 deletion src/aligo/core/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""..."""
# 导入顺序不能变, BaseClass 在前
# from .Config import *
from .Auth import Auth, aligo_config_folder
from .Auth import Auth, set_config_folder
from .BaseAligo import BaseAligo
from .Core import Core
from .Create import Create

0 comments on commit de122b0

Please sign in to comment.