add warnings about missing svg files

master
Ondřej Hruška 6 years ago
parent 4257fa4210
commit 3fbac24759
Signed by: MightyPork
GPG Key ID: 2C5FD5035250423D
  1. 16
      patcher/apply-filter.js

@ -24,12 +24,17 @@ function cp(src, dest) {
var data = fs.readFileSync(src, 'utf-8');
fs.writeFileSync(dest, data);
return true
}
// let manifest = JSON.parse(fs.readFileSync('templates/.fontcustom-manifest.json', 'utf-8'))
let fcyml = fs.readFileSync('../fontcustom.yml', 'utf-8')
let desired = fs.readFileSync('../wanted.ini', 'utf-8').split('\n').filter((x) => x.length && x[0] !== '#')
let desired = fs.readFileSync('../wanted.ini', 'utf-8').split('\n')
.filter((x) => x.length && x[0] !== '#')
.map((x) => x.trim().replace(/\s*#.*/, ''))
// TODO deal with aliases properly
console.log(`Including ${desired.length} icons`)
@ -72,7 +77,14 @@ rmInDir('../Fork-Awesome/src/icons/svg')
console.log('Copying desired files to FA~svg/ ...')
let any_bad = false
for (let a of desired) {
cp(`./templates/svg/${a}.svg`, `../Fork-Awesome/src/icons/svg/${a}.svg`)
if (!cp(`./templates/svg/${a}.svg`, `../Fork-Awesome/src/icons/svg/${a}.svg`)) {
console.log(`- \x1b[33mFile \x1b[31m"${a}.svg"\x1b[33m not found, probably a typo or alias\x1b[m`)
any_bad = true
}
}
if (any_bad) {
console.log(`\x1b[31mSome files were not found. If you included their aliases (e.g. save -> floppy-o), this is correct.\x1b[m`)
}

Loading…
Cancel
Save