2020-11-25 15:29:58 -05:00
|
|
|
|
2020-09-21 01:14:06 -04:00
|
|
|
import { computeTarballHash, updateJson } from "../local";
|
|
|
|
import { colorify, getProgressBar } from "../log";
|
2020-09-23 01:00:30 -04:00
|
|
|
import { dirnames, getPackageJsonPath } from "../path";
|
2020-09-21 01:14:06 -04:00
|
|
|
|
|
|
|
(async function() {
|
|
|
|
const progress = getProgressBar(colorify.bold("Updating package.json hashes"));
|
|
|
|
|
|
|
|
// Updating all tarball hashes now that versions have been updated
|
|
|
|
for (let i = 0; i < dirnames.length; i++) {
|
|
|
|
progress(i / dirnames.length);
|
2020-09-22 22:54:48 -04:00
|
|
|
|
2020-09-21 01:14:06 -04:00
|
|
|
const dirname = dirnames[i];
|
2020-09-22 22:54:48 -04:00
|
|
|
|
2020-09-23 01:00:30 -04:00
|
|
|
//const gitHead = await getGitTag(resolve("packages", dirname));
|
2020-09-21 01:14:06 -04:00
|
|
|
const tarballHash = computeTarballHash(dirname);
|
2020-09-22 22:54:48 -04:00
|
|
|
|
2020-09-23 01:00:30 -04:00
|
|
|
updateJson(getPackageJsonPath(dirname), { tarballHash }, true);
|
2020-09-21 01:14:06 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
progress(1);
|
2020-09-22 22:54:48 -04:00
|
|
|
|
2020-09-21 01:14:06 -04:00
|
|
|
})().catch((error) => {
|
|
|
|
console.log(error);
|
|
|
|
process.exit(1);
|
|
|
|
});;
|
|
|
|
|