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.
18 lines
452 B
18 lines
452 B
|
3 years ago
|
#!/usr/bin/env node
|
||
|
|
|
||
|
|
const fsProm = require('fs/promises');
|
||
|
|
|
||
|
|
const PKGJSON = 'package.json';
|
||
|
|
|
||
|
|
async function main() {
|
||
|
|
const pkgJson = JSON.parse(await fsProm.readFile(PKGJSON, 'utf8'));
|
||
|
|
for (const field of ['main', 'typings']) {
|
||
|
|
if (pkgJson["matrix_lib_"+field] !== undefined) {
|
||
|
|
pkgJson[field] = pkgJson["matrix_lib_"+field];
|
||
|
|
}
|
||
|
|
}
|
||
|
|
await fsProm.writeFile(PKGJSON, JSON.stringify(pkgJson, null, 2));
|
||
|
|
}
|
||
|
|
|
||
|
|
main();
|