Something went wrong. Try again.
A decentralized music tracking and discovery platform built on AT Protocol 🎵 rocksky.app
spotify atproto lastfm musicbrainz scrobbling listenbrainz
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041import chalk from "chalk";import { mkdirSync, readdirSync, statSync } from "fs";import { dirname } from "path";import { join } from "path";import { $ } from "zx";import { consola } from "consola";
function getPklFilesRecursive(dir: string): string[] { const entries = readdirSync(dir); const files: string[] = [];
for (const entry of entries) { const fullPath = join(dir, entry); const stats = statSync(fullPath);
if (stats.isDirectory()) { files.push(...getPklFilesRecursive(fullPath)); continue; }
if (entry.endsWith(".pkl")) { files.push(fullPath); } }
return files;}
const files = await getPklFilesRecursive(join("pkl", "defs"));
await Promise.all( files.map(async (fullPath) => { consola.info(`pkl eval ${chalk.cyan(fullPath)}`); const out = fullPath .replace(/\.pkl$/, ".json") .replace(/pkl[\\\/]defs/g, "lexicons"); mkdirSync(dirname(out), { recursive: true }); await $`pkl eval -f json ${fullPath} > ${out}`; }),);