You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
1.1 KiB
34 lines
1.1 KiB
#!/usr/bin/env node
|
|
|
|
const fs = require('fs')
|
|
|
|
// the manifest file is easier to parse for us, but the actual source file is icons.yml
|
|
let manifest = JSON.parse(fs.readFileSync('./templates/.fontcustom-manifest.json', 'utf-8'))
|
|
let fcyml = fs.readFileSync('./templates/fontcustom.yml', 'utf-8')
|
|
|
|
let all_enabled = []
|
|
let all_disabled = []
|
|
|
|
for (var key in manifest.glyphs){
|
|
if (manifest.glyphs.hasOwnProperty(key)) {
|
|
all_enabled.push(key)
|
|
all_disabled.push(`#${key}`)
|
|
}
|
|
}
|
|
|
|
console.log(`Found ${all_enabled.length} icons in manifest, writing template files`)
|
|
|
|
console.log(`\x1b[32m[Writing]\x1b[m wanted.all.ini`)
|
|
fs.writeFileSync('../wanted.all.ini', all_enabled.join('\n') + '\n')
|
|
|
|
console.log(`\x1b[32m[Writing]\x1b[m wanted.none.ini`)
|
|
fs.writeFileSync('../wanted.none.ini', all_disabled.join('\n') + '\n')
|
|
|
|
|
|
console.log(`\x1b[32m[Writing]\x1b[m fontcustom.default.yml`)
|
|
fs.writeFileSync('../fontcustom.default.yml', fcyml)
|
|
|
|
if (!fs.existsSync('../fontcustom.yml')) {
|
|
console.log(`\x1b[32m[Writing]\x1b[m fontcustom.yml (did not exist)`)
|
|
fs.writeFileSync('../fontcustom.yml', fcyml)
|
|
}
|
|
|