diff --git a/Contentless/Config.cs b/Contentless/Config.cs index d1dd626..918e5f2 100644 --- a/Contentless/Config.cs +++ b/Contentless/Config.cs @@ -30,4 +30,4 @@ public class Override { [JsonProperty("copy")] public bool Copy; -} \ No newline at end of file +} diff --git a/Contentless/Program.cs b/Contentless/Program.cs index 86a1bd0..11baf57 100644 --- a/Contentless/Program.cs +++ b/Contentless/Program.cs @@ -143,7 +143,7 @@ public static class Program { Console.WriteLine($"Found possible importer types {string.Join(", ", importers)}"); Console.WriteLine($"Found possible processor types {string.Join(", ", processors)}"); - var excluded = config.ExcludedFiles.Select(Program.MakeFileRegex).ToArray(); + var excluded = config.ExcludedFiles.Select(Program.GlobbyRegex).ToArray(); var overrides = Program.GetOverrides(config.Overrides).ToArray(); foreach (var file in contentFile.Directory.EnumerateFiles("*", SearchOption.AllDirectories)) { // is the file the content or config file? @@ -271,7 +271,7 @@ public static class Program { private static IEnumerable GetOverrides(Dictionary config) { foreach (var entry in config) - yield return new OverrideInfo(Program.MakeFileRegex(entry.Key), entry.Value); + yield return new OverrideInfo(Program.GlobbyRegex(entry.Key), entry.Value); } private static OverrideInfo GetOverrideFor(string file, IEnumerable overrides) { @@ -327,8 +327,8 @@ public static class Program { Console.WriteLine($"Adding file {relative} with the Copy build action"); } - private static Regex MakeFileRegex(string s) { + private static Regex GlobbyRegex(string s) { return new Regex(s.Replace(".", "[.]").Replace("*", ".*").Replace("?", ".")); } -} \ No newline at end of file +} diff --git a/README.md b/README.md index 3d64858..929f43c 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Contentless will now automatically add any content files from your `Content` dir If you want to change the way Contentless works, you can use a configuration file. To do so, simply create a file named `Contentless.json` in the same directory as your `Content.mgcb` file. You can use the config to change several options: ```json5 { - // The list of files that should be excluded. Can use regex. + // The list of files that should be excluded. Can use simple glob-style patterns including "*" and "?". // Default: ["obj/", "bin/"] "exclude": [ "obj/", @@ -33,10 +33,10 @@ If you want to change the way Contentless works, you can use a configuration fil // If any files that were skipped without errors should be logged (Files that already have entries or files that were ignored) // Default: true "logSkipped": true, - // The list of files that should use a different importer or processor than the one that Contentless automatically determined. Can use regex. + // The list of files that should use a different importer or processor than the one that Contentless automatically determined. Can use simple glob-style patterns including "*" and "?". // Default: {} "overrides": { - // Example: Make all files matching the regex ".json" use the importer "JsonImporter" + // Example: Make all files matching ".json" use the importer "JsonImporter" ".json": { "importer": "JsonImporter" },