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>(
127
127
const httpRequestOptions = options ?. requestOptions ?? { } ;
128
128
const httpGetModulePath = resolvePath ( options ?. getModulePath , context ) ;
129
129
130
- makeDirs ( path . dirname ( jsonFilePath ) ) ;
130
+ fs . mkdirSync ( path . dirname ( jsonFilePath ) , { recursive : true } ) ;
131
131
132
132
let data , timestamp ;
133
133
try {
@@ -211,20 +211,6 @@ function postProcess<T>(
211
211
return data ;
212
212
}
213
213
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
-
228
214
/**
229
215
* JSON Schema to string
230
216
*/
You can’t perform that action at this time.
0 commit comments