mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
fix setting load
This commit is contained in:
1 parent
2d5eef8d08
commit
0f23611853
4 files changed
+15
-4
No files matched your search
@@ -87,6 +87,8 @@ export async function setting(pending: string[], fail: string[], modelSetting: t
|
||||
};
|
||||
for (const i of pending) {
|
||||
let p = path.resolve(i, 'setting.yaml');
|
||||
const t = i.split(path.sep);
|
||||
const name = t[t.length - 1];
|
||||
if (!fs.existsSync(p)) p = path.resolve(i, 'settings.yaml');
|
||||
if (fs.existsSync(p) && !fail.includes(i)) {
|
||||
try {
|
||||
@@ -94,7 +96,7 @@ export async function setting(pending: string[], fail: string[], modelSetting: t
|
||||
for (const key in cfg) {
|
||||
map[cfg[key].category || 'system'](
|
||||
modelSetting.Setting(
|
||||
i, `${i}.${key}`, cfg[key].range, cfg[key].default,
|
||||
name, `${name}.${key}`, cfg[key].range, cfg[key].default,
|
||||
cfg[key].type || 'text', cfg[key].name || key, cfg[key].desc || '',
|
||||
),
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user