INNER CODE UNIT · JavaScript

main

ImranR98/apps.obtainium.imranr.dev · scripts/validate_icons.js:128

async function main() {
  const files = targetPaths.length
    ? targetPaths.flatMap(target => {
        const stat = fs.statSync(target)
        return stat.isDirectory() ? getAllJsonFiles(target) : [target]
      })
    : getAllJsonFiles(APPS_DIR)
  console.log(`Found ${files.length} JSON files`)

  const stats = { checked: 0, clean: 0, bad: 0, unverified: 0, fixed: 0, parseErrors: 0 }
  await runPool(files, file => processFile(file, stats), CONCURRENCY)

  console.log(
    `Done: ${stats.checked} icon(s) checked — ${stats.clean} OK, ${stats.bad} bad, ` +
    `${stats.unverified} unverified, ${stats.fixed} fixed, ${stats.parseErrors} parse error(s)`
  )
  if (dryRun) console.log('Dry run completed - no files were modified')
  if (check && stats.bad > 0) process.exit(1)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…