feat: 主目录存在 DEBUG.txt 时每次开始任务都重新解析tasks.json

This commit is contained in:
uye
2023-07-31 11:32:30 +08:00
parent 67538b8c0e
commit 0b1bb2f6c7
2 changed files with 23 additions and 0 deletions

View File

@@ -51,10 +51,16 @@ std::shared_ptr<asst::TaskInfo> asst::TaskData::get(std::string_view name)
return expand_task(name, get_raw(name)).value_or(nullptr);
}
const bool forcedReloadResource = std::ifstream("DEBUG").good() || std::ifstream("DEBUG.txt").good();
bool asst::TaskData::parse(const json::value& json)
{
LogTraceFunction;
if (forcedReloadResource) {
m_all_tasks_info.clear();
}
const auto& json_obj = json.as_object();
{