MCPcopy Create free account
hub / github.com/SchemaStore/schemastore / taskBuildWebsite

Function taskBuildWebsite

cli.js:926–1199  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

924}
925
926async function taskBuildWebsite() {
927 await fs.mkdir('./website/schemas/json', { recursive: true })
928 await Promise.all(
929 SchemasToBeTested.map((schemaName) => {
930 return fs
931 .copyFile(
932 path.join(SchemaDir, schemaName),
933 path.join('./website', schemaName),
934 )
935 .catch((err) => {
936 if (err.code !== 'EISDIR') throw err
937 })
938 }),
939 )
940 await Promise.all(
941 SchemasToBeTested.map((schemaName) => {
942 return fs
943 .copyFile(
944 path.join(SchemaDir, schemaName),
945 path.join('./website', path.parse(schemaName).name),
946 )
947 .catch((err) => {
948 if (err.code !== 'EISDIR') throw err
949 })
950 }),
951 )
952 await Promise.all(
953 SchemasToBeTested.map((schemaName) => {
954 return fs
955 .copyFile(
956 path.join(SchemaDir, schemaName),
957 path.join('./website/schemas/json', schemaName),
958 )
959 .catch((err) => {
960 if (err.code !== 'EISDIR') throw err
961 })
962 }),
963 )
964 await Promise.all(
965 SchemasToBeTested.map((schemaName) => {
966 return fs
967 .copyFile(
968 path.join(SchemaDir, schemaName),
969 path.join('./website/schemas/json', path.parse(schemaName).name),
970 )
971 .catch((err) => {
972 if (err.code !== 'EISDIR') throw err
973 })
974 }),
975 )
976
977 const pageTitle = 'JSON Schema Store'
978 const pageDescription = 'JSON Schemas for common JSON file formats'
979 const body = `<article id="schemalist">
980 <h3 id="count">JSON Schemas are available for the following {0} files:</h3>
981
982 <input type="search" placeholder="Search schemas" id="search" />
983 <ul id="schemas" class="columns" role="directory" data-api="/api/json/catalog.json"></ul>

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected