Skip to content

Commit 72a7004

Browse files
committed
fixed file auto generation failure
1 parent b1ee8fa commit 72a7004

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

mcd_task/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ def on_player_joined(server: PluginServerInterface, player: str, info: Info):
4747
def on_load(server: PluginServerInterface, prev_module):
4848
if prev_module is not None:
4949
pass
50-
if not os.path.isdir(DATA_FOLDER):
51-
os.makedirs(DATA_FOLDER)
5250
GlobalVariables.set_config(Config.load(server))
5351
GlobalVariables.setup_task_manager(TaskManager.load())
5452
register_cmd_tree(server)

mcd_task/constants.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
# Data folder
1212
DATA_FOLDER = "./config/task"
13+
if not os.path.isdir(DATA_FOLDER):
14+
os.makedirs(DATA_FOLDER)
1315
# Config file path
1416
CONFIG_PATH = os.path.join(DATA_FOLDER, "config.json")
1517
# Task file path

mcd_task/global_variables.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import logging
2+
import os.path
23
import re
34
import types
45
from typing import Optional, Union, TYPE_CHECKING
56
from mcdreforged.api.all import RTextBase, RTextList, RText, RAction, ServerInterface, MCDReforgedLogger
67

78
from mcd_task.config import Config
8-
from mcd_task.constants import LOG_PATH, PREFIX, DEBUG_MODE
9+
from mcd_task.constants import LOG_PATH, PREFIX, DEBUG_MODE, DATA_FOLDER
910

1011

1112
if TYPE_CHECKING:

mcdreforged.plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "mcd_task",
3-
"version": "2.3.0+build.62",
3+
"version": "2.3.1+build.63",
44
"name": "Task",
55
"description": {
66
"en_us": "A plugin to show tasks of project in progress",

0 commit comments

Comments
 (0)