File tree Expand file tree Collapse file tree 2 files changed +6
-15
lines changed Expand file tree Collapse file tree 2 files changed +6
-15
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " eslint-plugin-json-schema-validator " : patch
3+ ---
4+
5+ fix: don't crash if schema cache directories already exist
Original file line number Diff line number Diff line change @@ -127,7 +127,7 @@ function loadJsonFromURL<T>(
127127 const httpRequestOptions = options ?. requestOptions ?? { } ;
128128 const httpGetModulePath = resolvePath ( options ?. getModulePath , context ) ;
129129
130- makeDirs ( path . dirname ( jsonFilePath ) ) ;
130+ fs . mkdirSync ( path . dirname ( jsonFilePath ) , { recursive : true } ) ;
131131
132132 let data , timestamp ;
133133 try {
@@ -211,20 +211,6 @@ function postProcess<T>(
211211 return data ;
212212}
213213
214- /**
215- * Make directories
216- */
217- function makeDirs ( dir : string ) {
218- const dirs = [ dir ] ;
219- while ( ! fs . existsSync ( dirs [ 0 ] ) ) {
220- dirs . unshift ( path . dirname ( dirs [ 0 ] ) ) ;
221- }
222- dirs . shift ( ) ;
223- for ( const dir of dirs ) {
224- fs . mkdirSync ( dir ) ;
225- }
226- }
227-
228214/**
229215 * JSON Schema to string
230216 */
You can’t perform that action at this time.
0 commit comments