refactor: shorten steps by using dedicated step, and test underlying micro steps

This commit is contained in:
linonetwo 2025-12-06 01:41:22 +08:00
parent dda10b25fb
commit ed01ba8036
5 changed files with 183 additions and 119 deletions

View file

@ -777,14 +777,14 @@ ${tiddler.content}
if (!await fs.pathExists(mainWikiPath)) {
await fs.copy(templatePath, mainWikiPath);
// Remove .git from template
await fs.remove(path.join(mainWikiPath, '.git')).catch(() => { /* ignore */ });
await fs.remove(path.join(mainWikiPath, '.git')).catch(() => {/* ignore */});
}
// 4. Update settings.json with both main wiki and sub-wiki workspaces
await fs.ensureDir(settingsDirectory);
let settings: { workspaces?: Record<string, IWorkspace> } & Record<string, unknown> = {};
if (await fs.pathExists(settingsPath)) {
settings = await fs.readJson(settingsPath);
settings = await fs.readJson(settingsPath) as { workspaces?: Record<string, IWorkspace> };
}
// Generate unique IDs