Skip to content

Commit 0cfb0eb

Browse files
ignore scripts with # at the beginning
1 parent 8bc235b commit 0cfb0eb

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Plugin/FileSystem.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
using LabApi.Features.Console;
44
using LabApi.Loader.Features.Paths;
55
using SER.FlagSystem;
6+
using SER.Helpers;
7+
using SER.Helpers.Extensions;
68
using SER.ScriptSystem;
79
using SER.ScriptSystem.Structures;
810

@@ -15,7 +17,13 @@ public static class FileSystem
1517

1618
public static void UpdateScriptPathCollection()
1719
{
18-
RegisteredScriptPaths = Directory.GetFiles(DirPath, "*.txt", SearchOption.AllDirectories);
20+
RegisteredScriptPaths = Directory
21+
.GetFiles(DirPath, "*.txt", SearchOption.AllDirectories)
22+
// ignore files with a pound sign at the start
23+
.Where(path => Path.GetFileName(path).FirstOrDefault() != '#')
24+
.ToArray();
25+
26+
//Log.Signal(RegisteredScriptPaths.JoinStrings(" "));
1927

2028
var duplicates = RegisteredScriptPaths
2129
.Select(Path.GetFileNameWithoutExtension)

0 commit comments

Comments
 (0)