Make script throw on fail

main
Johannes Andersen 4 years ago
parent afbcc17ab9
commit 3265a60a0d
No known key found for this signature in database
GPG Key ID: 5D8D41426C95C066

@ -6,8 +6,7 @@ const { technologies, categories } = JSON.parse(
fs.readFileSync('./src/technologies.json')
)
try {
Object.keys(technologies).forEach((name) => {
Object.keys(technologies).forEach((name) => {
const technology = technologies[name]
// Validate regular expressions
@ -21,9 +20,7 @@ try {
: technology[type]
Object.keys(keyed).forEach((key) => {
const patterns = Array.isArray(keyed[key])
? keyed[key]
: [keyed[key]]
const patterns = Array.isArray(keyed[key]) ? keyed[key] : [keyed[key]]
patterns.forEach((pattern, index) => {
const id = `${name}: ${type}[${key === '_' ? `${index}` : key}]`
@ -154,10 +151,10 @@ try {
}
})
}
})
})
// Validate icons
fs.readdirSync(iconPath).forEach((file) => {
// Validate icons
fs.readdirSync(iconPath).forEach((file) => {
const filePath = `${iconPath}/${file}`
if (fs.statSync(filePath).isFile() && !file.startsWith('.')) {
@ -172,8 +169,4 @@ try {
throw new Error(`Extraneous file: ${filePath}}`)
}
}
})
} catch (error) {
// eslint-disable-next-line no-console
console.error(error.message)
}
})

@ -1513,7 +1513,7 @@
1
],
"html": "<[^>]+data-apos-refreshable[^>]",
"icon": "ApostropheCMS.svg",
"icon": "apostrophecms.svg",
"implies": "Node.js",
"website": "http://apostrophecms.org"
},

Loading…
Cancel
Save