fix create config.json

This commit is contained in:
GiuDev 2025-05-13 10:13:18 +02:00
parent fab21e572c
commit abf8e37e0f

View File

@ -36,8 +36,13 @@ class ConfigManager:
base_path = os.path.dirname(sys.executable)
else:
# Use the current directory where the script is executed
base_path = os.getcwd()
# Get the actual path of the module file
current_file_path = os.path.abspath(__file__)
# Navigate upwards to find the project root
# Assuming this file is in a package structure like StreamingCommunity/Util/config_json.py
# We need to go up 2 levels to reach the project root
base_path = os.path.dirname(os.path.dirname(os.path.dirname(current_file_path)))
# Initialize file paths
self.file_path = os.path.join(base_path, file_name)