File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -94,8 +94,14 @@ export async function finalizeAndWriteData(
9494 monorepoFileData : MonorepoFileData ,
9595) {
9696 const packagePath = path . join ( PACKAGES_PATH , packageData . directoryName ) ;
97- if ( ( await fs . stat ( packagePath ) ) . isDirectory ( ) ) {
98- throw new Error ( `The package directory already exists: ${ packagePath } ` ) ;
97+ try {
98+ if ( ( await fs . stat ( packagePath ) ) . isDirectory ( ) ) {
99+ throw new Error ( `The package directory already exists: ${ packagePath } ` ) ;
100+ }
101+ } catch ( error ) {
102+ if ( ( error as NodeJS . ErrnoException ) . code !== 'ENOENT' ) {
103+ throw error ;
104+ }
99105 }
100106
101107 console . log ( 'Writing package and monorepo files...' ) ;
@@ -136,7 +142,7 @@ async function writeJsonFile(
136142) : Promise < void > {
137143 await fs . writeFile (
138144 filePath ,
139- prettierFormat ( fileContent , { ...prettierRc , parser : 'json' } ) ,
145+ await prettierFormat ( fileContent , { ...prettierRc , parser : 'json' } ) ,
140146 ) ;
141147}
142148
You can’t perform that action at this time.
0 commit comments