MCPcopy Index your code
hub / github.com/fontsource/fontsource / rebuild

Function rebuild

packages/cli/src/custom/rebuilder.ts:28–55  ·  view source on GitHub ↗
(opts?: RebuildOptions)

Source from the content-addressed store, hash-verified

26
27// Run rebuild
28export const rebuild = async (opts?: RebuildOptions) => {
29 const dir = './fonts/other';
30 const directories = getDirectories(dir, opts?.cwd);
31
32 for (const directory of directories) {
33 const fontDir = path.join(opts?.cwd ?? process.cwd(), dir, directory);
34 const metadata = await getMetadata(fontDir);
35 const pkgJson = await getPackageJson(fontDir);
36
37 // Delete everything in dir except files
38 const files = await fs.readdir(fontDir);
39 for (const file of files) {
40 if (file !== 'files' && file !== 'LICENSE') {
41 await fs.remove(path.join(fontDir, file));
42 }
43 }
44
45 await buildCustom(metadata, {
46 dir,
47 version: pkgJson.version,
48 publishHash: pkgJson.publishHash,
49 });
50
51 consola.info(`Rebuilt ${metadata.id}.`);
52 }
53
54 await verifyAll();
55};

Callers 1

cli.tsFile · 0.90

Calls 7

getDirectoriesFunction · 0.90
buildCustomFunction · 0.90
verifyAllFunction · 0.90
getPackageJsonFunction · 0.85
getMetadataFunction · 0.70
removeMethod · 0.65
infoMethod · 0.65

Tested by

no test coverage detected