Skip to content

Commit 2b7e081

Browse files
move FileSystem
1 parent adac840 commit 2b7e081

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,18 @@
77
using SER.ScriptSystem;
88
using SER.ScriptSystem.Structures;
99

10-
namespace SER.Plugin;
10+
namespace SER.FileSystem;
1111

1212
public static class FileSystem
1313
{
14-
public static readonly string DirPath = Path.Combine(PathManager.Configs.FullName, "Scripted Events Reloaded");
14+
public static readonly string MainDirPath = Path.Combine(PathManager.Configs.FullName, "Scripted Events Reloaded");
15+
public static readonly string DbDirPath = Path.Combine(MainDirPath, "Databases");
1516
public static string[] RegisteredScriptPaths = [];
1617

1718
public static void UpdateScriptPathCollection()
1819
{
1920
RegisteredScriptPaths = Directory
20-
.GetFiles(DirPath, "*.txt", SearchOption.AllDirectories)
21+
.GetFiles(MainDirPath, "*.txt", SearchOption.AllDirectories)
2122
// ignore files with a pound sign at the start
2223
.Where(path => Path.GetFileName(path).FirstOrDefault() != '#')
2324
.ToArray();
@@ -44,9 +45,9 @@ public static void UpdateScriptPathCollection()
4445

4546
public static void Initialize()
4647
{
47-
if (!Directory.Exists(DirPath))
48+
if (!Directory.Exists(MainDirPath))
4849
{
49-
Directory.CreateDirectory(DirPath);
50+
Directory.CreateDirectory(MainDirPath);
5051
return;
5152
}
5253

@@ -95,7 +96,7 @@ public static void GenerateExamples()
9596
.Where(t => typeof(IExample).IsAssignableFrom(t) && !t.IsAbstract)
9697
.Select(t => t.CreateInstance<IExample>());
9798

98-
var exampleDir = Directory.CreateDirectory(Path.Combine(DirPath, "Example Scripts"));
99+
var exampleDir = Directory.CreateDirectory(Path.Combine(MainDirPath, "Example Scripts"));
99100
foreach (var example in examples)
100101
{
101102
var path = Path.Combine(exampleDir.FullName, $"{example.Name}.txt");

0 commit comments

Comments
 (0)