Skip to content

Commit 36e160c

Browse files
committed
Added folder validation
1 parent 9bbc81f commit 36e160c

File tree

3 files changed

+30
-1
lines changed

3 files changed

+30
-1
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.IO;
4+
using System.Linq;
5+
using System.Text;
6+
using System.Threading.Tasks;
7+
8+
namespace DynmapFilesToSQLite.Converter {
9+
public class Converter {
10+
public static void Convert(DirectoryInfo tilesFolder, DirectoryInfo markersFolder, bool useJPG) {
11+
12+
}
13+
}
14+
}

DynmapFilesToSQLite/DynmapFilesToSQLite.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
<Reference Include="System.Xml" />
4949
</ItemGroup>
5050
<ItemGroup>
51+
<Compile Include="Converter\Converter.cs" />
5152
<Compile Include="Program.cs" />
5253
<Compile Include="Properties\AssemblyInfo.cs" />
5354
</ItemGroup>

DynmapFilesToSQLite/Program.cs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
using Mono.Options;
2+
using System;
3+
using System.IO;
24

35
namespace DynmapFilesToSQLite {
46
class Program {
@@ -12,7 +14,19 @@ static void Main(string[] args) {
1214
};
1315
options.Parse(args);
1416

15-
17+
DirectoryInfo tilesFolder = new DirectoryInfo(tilesFolderPath);
18+
if(!tilesFolder.Exists) {
19+
Console.WriteLine("Tiles folder not found");
20+
return;
21+
}
22+
23+
DirectoryInfo markersFolder = new DirectoryInfo(Path.Combine(tilesFolder.FullName, "_markers_")));
24+
if (!markersFolder.Exists) {
25+
Console.WriteLine("Tiles folder invalid");
26+
return;
27+
}
28+
29+
Converter.Converter.Convert(tilesFolder, markersFolder, useJPGs);
1630
}
1731
}
1832
}

0 commit comments

Comments
 (0)