File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -3,10 +3,6 @@ import chalk from "chalk";
33import { promises as fs } from "fs" ;
44import prettier from "prettier" ;
55
6- import existingContributors from "../.all-contributorsrc.json" assert { type : "json " } ;
7- import existingPackage from "../package.json" assert { type : "json " } ;
8- import outcomeLabels from "./labels.json" assert { type : "json " } ;
9-
106let caughtError ;
117
128try {
8783 console . log ( ) ;
8884 console . log ( chalk . gray `Hydrating package metadata locally...` ) ;
8985
86+ async function readFileAsJSON ( filePath ) {
87+ return JSON . parse ( ( await fs . readFile ( filePath ) ) . toString ( ) ) ;
88+ }
89+
90+ const [ existingContributors , existingPackage , outcomeLabels ] =
91+ await Promise . all ( [
92+ readFileAsJSON ( "./.all-contributorsrc" ) ,
93+ readFileAsJSON ( "./package.json" ) ,
94+ readFileAsJSON ( "./script/labels.json" ) ,
95+ ] ) ;
96+
9097 await fs . writeFile (
91- "./.all-contributorsrc.json " ,
98+ "./.all-contributorsrc" ,
9299 prettier . format (
93100 JSON . stringify ( {
94101 ...existingContributors ,
You can’t perform that action at this time.
0 commit comments