File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ public Configuration(ConverterVersion converterVersion) {
48
48
VerifyCK3Path ( ) ;
49
49
VerifyCK3Version ( converterVersion ) ;
50
50
VerifyImperatorDocPath ( ) ;
51
+ VerifyCK3ModsPath ( ) ;
51
52
52
53
Logger . IncrementProgress ( ) ;
53
54
}
@@ -236,6 +237,21 @@ private void VerifyImperatorDocPath() {
236
237
237
238
Logger . Debug ( $ "I:R documents path { ImperatorPath } is valid.") ;
238
239
}
240
+
241
+ private void VerifyCK3ModsPath ( ) {
242
+ if ( ! Directory . Exists ( CK3ModsPath ) ) {
243
+ throw new UserErrorException ( $ "{ CK3ModsPath } does not exist!") ;
244
+ }
245
+
246
+ // If the mods folder contains any files, at least one on them should have a .mod extension.
247
+ var filesInFolder = Directory . GetFiles ( CK3ModsPath ) ;
248
+ if ( filesInFolder . Length > 0 ) {
249
+ var modFiles = filesInFolder . Where ( f => f . EndsWith ( ".mod" , StringComparison . OrdinalIgnoreCase ) ) ;
250
+ if ( ! modFiles . Any ( ) ) {
251
+ throw new UserErrorException ( $ "{ CK3ModsPath } does not contain any .mod files!") ;
252
+ }
253
+ }
254
+ }
239
255
240
256
private void SetOutputName ( ) {
241
257
if ( string . IsNullOrWhiteSpace ( OutputModName ) ) {
You can’t perform that action at this time.
0 commit comments