File tree Expand file tree Collapse file tree 1 file changed +7
-11
lines changed
Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -203,23 +203,19 @@ export default class PrepareSecurityRelease extends SecurityRelease {
203203 }
204204
205205 async createVulnerabilitiesJSON ( reports , dependencies , releaseDate ) {
206- this . cli . separator ( 'Creating vulnerabilities.json...' ) ;
207- const file = JSON . stringify ( {
206+ this . cli . startSpinner ( 'Creating vulnerabilities.json...' ) ;
207+ const fileContent = JSON . stringify ( {
208208 releaseDate,
209209 reports,
210210 dependencies
211- } , null , 2 ) ;
211+ } , null , 2 ) + '\n' ;
212212
213- const folderPath = path . join ( process . cwd ( ) , NEXT_SECURITY_RELEASE_FOLDER ) ;
214- try {
215- fs . accessSync ( folderPath ) ;
216- } catch ( error ) {
217- fs . mkdirSync ( folderPath , { recursive : true } ) ;
218- }
213+ const folderPath = path . resolve ( NEXT_SECURITY_RELEASE_FOLDER ) ;
214+ await fs . promises . mkdir ( folderPath , { recursive : true } ) ;
219215
220216 const fullPath = path . join ( folderPath , 'vulnerabilities.json' ) ;
221- fs . writeFileSync ( fullPath , file ) ;
222- this . cli . ok ( `Created ${ fullPath } ` ) ;
217+ await fs . promises . writeFile ( fullPath , fileContent ) ;
218+ this . cli . stopSpinner ( `Created ${ fullPath } ` ) ;
223219
224220 return fullPath ;
225221 }
You can’t perform that action at this time.
0 commit comments