File tree Expand file tree Collapse file tree 1 file changed +37
-34
lines changed Expand file tree Collapse file tree 1 file changed +37
-34
lines changed Original file line number Diff line number Diff line change @@ -145,45 +145,48 @@ async function generateDocs(
145
145
`"mainEntryPointFilePath": "<projectFolder>/dist/esm5/index.d.ts"` ,
146
146
`"mainEntryPointFilePath": "<projectFolder>/dist/esm5/index.doc.d.ts"`
147
147
) ;
148
- fs . writeFileSync (
149
- `${ projectRoot } /packages/auth/api-extractor.json` ,
150
- authApiConfigModified
151
- ) ;
152
148
153
- if ( skipBuild ) {
154
- await spawn ( 'yarn' , [ 'api-report' ] , {
155
- stdio : 'inherit'
156
- } ) ;
157
- } else {
158
- // api-report is run as part of every build
159
- await spawn (
160
- 'yarn' ,
161
- [
162
- 'lerna' ,
163
- 'run' ,
164
- '--scope' ,
165
- '@firebase/*' ,
166
- '--ignore' ,
167
- '@firebase/*-compat' ,
168
- 'build'
169
- ] ,
170
- {
149
+ try {
150
+ fs . writeFileSync (
151
+ `${ projectRoot } /packages/auth/api-extractor.json` ,
152
+ authApiConfigModified
153
+ ) ;
154
+
155
+ if ( skipBuild ) {
156
+ await spawn ( 'yarn' , [ 'api-report' ] , {
171
157
stdio : 'inherit'
172
- }
158
+ } ) ;
159
+ } else {
160
+ // api-report is run as part of every build
161
+ await spawn (
162
+ 'yarn' ,
163
+ [
164
+ 'lerna' ,
165
+ 'run' ,
166
+ '--scope' ,
167
+ '@firebase/*' ,
168
+ '--ignore' ,
169
+ '@firebase/*-compat' ,
170
+ 'build'
171
+ ] ,
172
+ {
173
+ stdio : 'inherit'
174
+ }
175
+ ) ;
176
+ }
177
+ } finally {
178
+ // Restore original auth api-extractor.json contents.
179
+ fs . writeFileSync (
180
+ `${ projectRoot } /packages/auth/api-extractor.json` ,
181
+ authApiConfigOriginal
182
+ ) ;
183
+ // Restore original auth.api.md
184
+ fs . writeFileSync (
185
+ `${ projectRoot } /common/api-review/auth.api.md` ,
186
+ authApiReportOriginal
173
187
) ;
174
188
}
175
189
176
- // Restore original auth api-extractor.json contents.
177
- fs . writeFileSync (
178
- `${ projectRoot } /packages/auth/api-extractor.json` ,
179
- authApiConfigOriginal
180
- ) ;
181
- // Restore original auth.api.md
182
- fs . writeFileSync (
183
- `${ projectRoot } /common/api-review/auth.api.md` ,
184
- authApiReportOriginal
185
- ) ;
186
-
187
190
if ( ! fs . existsSync ( tmpDir ) ) {
188
191
fs . mkdirSync ( tmpDir ) ;
189
192
}
You can’t perform that action at this time.
0 commit comments