ethers.js/misc/admin/src.ts/cmds/hoist.ts

18 lines
551 B
TypeScript
Raw Normal View History

import { dirs, isEthers } from "../path";
import { getDependencies, updateJson } from "../local";
2020-09-23 05:54:48 +03:00
import { colorify } from "../log";
(async function() {
const dependencies = getDependencies(null, (name: string) => {
return !isEthers(name);
});
2020-09-23 05:54:48 +03:00
console.log(colorify.bold(`Hoisting ${ dependencies.length } dependencies into root package...`));
updateJson(dirs.rootPackageJsonPath, { dependencies });
})().catch((error) => {
console.log(`Error running ${ process.argv[0] }: ${ error.message }`);
process.exit(1);
});