/
githubmirror
/
Front-End-Checklist
Обзор
Документация
Войти
/
githubmirror
/
Front-End-Checklist
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
packages/rules/src/sync-rules.ts
17 строк
716 B
David Dias
chore: new v2 version
30 май 2026, 00:54
30 май 2026, 00:54
7c05904
Код
Авторство
О чём код?
import * as fs from 'node:fs' import * as path from 'node:path' import { fileURLToPath } from 'node:url' const packageRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..') const sourceRulesDir = path.resolve(packageRoot, '../content/rules/en') const targetRulesDir = path.resolve(packageRoot, 'rules/en') if (!fs.existsSync(sourceRulesDir)) { throw new Error(`Source rules directory not found: ${sourceRulesDir}`) } fs.rmSync(path.resolve(packageRoot, 'rules'), { recursive: true, force: true }) fs.mkdirSync(path.dirname(targetRulesDir), { recursive: true }) fs.cpSync(sourceRulesDir, targetRulesDir, { recursive: true }) process.stdout.write(`Copied public rules into ${targetRulesDir}\n`)