mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-05-11 18:10:15 +08:00
fix(log): add support for CONFIG_DIR through environment variables
This commit is contained in:
@@ -5,7 +5,7 @@ import re
|
||||
import shutil
|
||||
import sys
|
||||
from pathlib import Path
|
||||
from typing import List, Union, Tuple
|
||||
from typing import List, Union, Tuple, Optional
|
||||
|
||||
import docker
|
||||
import psutil
|
||||
@@ -473,10 +473,14 @@ class SystemUtils:
|
||||
return os.stat(src).st_dev == os.stat(dest).st_dev
|
||||
|
||||
@staticmethod
|
||||
def get_config_path() -> Path:
|
||||
def get_config_path(config_dir: Optional[str] = None) -> Path:
|
||||
"""
|
||||
获取配置路径
|
||||
"""
|
||||
if not config_dir:
|
||||
config_dir = os.getenv("CONFIG_DIR")
|
||||
if config_dir:
|
||||
return Path(config_dir)
|
||||
if SystemUtils.is_docker():
|
||||
return Path("/config")
|
||||
elif SystemUtils.is_frozen():
|
||||
|
||||
Reference in New Issue
Block a user