File tree 1 file changed +7
-1
lines changed
1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 1
- import { readdirSync } from "fs" ;
1
+ import fs , { readdirSync } from "fs" ;
2
2
import path from "path" ;
3
3
import { CustomFormatResource } from "./__generated__/generated-sonarr-api" ;
4
4
import { getArrApi } from "./api" ;
@@ -91,6 +91,12 @@ export const loadLocalCfs = async (): Promise<CFProcessing | null> => {
91
91
}
92
92
93
93
const cfPath = path . resolve ( config . localCustomFormatsPath ) ;
94
+
95
+ if ( ! fs . existsSync ( cfPath ) ) {
96
+ console . log ( `Provided local custom formats path '${ config . localCustomFormatsPath } ' does not exist.` ) ;
97
+ return null ;
98
+ }
99
+
94
100
const files = readdirSync ( `${ cfPath } ` ) . filter ( ( fn ) => fn . endsWith ( "json" ) ) ;
95
101
const carrIdToObject = new Map < string , { carrConfig : ConfigarrCF ; requestConfig : CustomFormatResource } > ( ) ;
96
102
const cfNameToCarrObject = new Map < string , ConfigarrCF > ( ) ;
You can’t perform that action at this time.
0 commit comments