Source identity
| Field | Recorded value |
|---|---|
| Source type | GitHub source |
| Original record | Janady13/llms-txt-hub / scripts/check-mdx-length.ts |
| Date | Not specified in source |
| Repository | Janady13/llms-txt-hub |
| Revision | e0f4bf978d4df168369c7601d9c5f5ea89e84377 |
| Branch | main |
| Path or archive member | scripts/check-mdx-length.ts |
| Original SHA-256 | 30c39244e2063ed39d720e5f08e815d1046ad4126ccadb2daad34ce45dc150c8 |
| Git blob SHA | dbb5a8ae3561d01f31468eb2f8dd28362763d788 |
| Reading-copy SHA-256 | 30c39244e2063ed39d720e5f08e815d1046ad4126ccadb2daad34ce45dc150c8 |
Recovered source transcript
Download complete source text ↓22 lines · 0.4 KB
import fs from 'node:fs'
const files = process.argv.slice(2)
const MAX_LENGTH = 50
let hasError = false
files.forEach(file => {
if (!fs.existsSync(file)) {
return
}
const baseName = file.split('/').pop()?.replace('.mdx', '') || ''
if (baseName.length > MAX_LENGTH) {
console.log(`❌ ERROR: The file '${file}' exceeds the limit of ${MAX_LENGTH} characters!`)
hasError = true
}
})
if (hasError) {
process.exit(1)
}