resources

This commit is contained in:
2026-02-24 16:44:22 +00:00
parent d6ffe43a11
commit 05f0d0e8f7
39 changed files with 1385 additions and 1057 deletions
+32
View File
@@ -0,0 +1,32 @@
import { readdirSync, existsSync, mkdirSync, cpSync } from 'node:fs';
import { join } from 'node:path';
import { SEED_PATH, DATA_PATH } from './data-path';
const SEED_TASKS_DIR = join(SEED_PATH, 'tasks');
const GLOBAL_TASKS_DIR = join(DATA_PATH, 'tasks');
export function syncSeedTasks(): void {
if (!existsSync(SEED_TASKS_DIR)) return;
mkdirSync(GLOBAL_TASKS_DIR, { recursive: true });
const seedEntries = readdirSync(SEED_TASKS_DIR, { withFileTypes: true });
for (const entry of seedEntries) {
if (!entry.isDirectory()) continue;
const seedTaskDir = join(SEED_TASKS_DIR, entry.name);
const taskFile = join(seedTaskDir, 'TASK.md');
if (!existsSync(taskFile)) continue;
const targetDir = join(GLOBAL_TASKS_DIR, entry.name);
if (existsSync(targetDir)) {
// Task already exists in DATA_PATH — skip to preserve user edits
continue;
}
cpSync(seedTaskDir, targetDir, { recursive: true });
console.log(`[tasks] Synced seed task: ${entry.name}`);
}
}