1
0
mirror of https://github.com/h3poteto/whalebird-desktop synced 2024-12-12 08:46:34 +01:00
Whalebird-desktop-client-ma.../scripts/thirdparty.js
2023-05-10 01:01:01 +09:00

28 lines
638 B
JavaScript

const path = require('path')
const fs = require('fs')
const npmPath = path.join(__dirname, '../thirdparty.json')
const outPath = path.join(__dirname, '../', 'src', 'config', 'thirdparty.json')
const npmData = JSON.parse(fs.readFileSync(npmPath))
let npm = Object.keys(npmData).map(k => {
let r = {
package_name: k,
license: npmData[k].licenses
}
if (npmData[k].publisher) {
r = Object.assign(r, {
publisher: npmData[k].publisher
})
}
if (npmData[k].repository) {
r = Object.assign(r, {
repository: npmData[k].repository
})
}
return r
})
fs.writeFileSync(outPath, JSON.stringify(npm))