fixed .txt based tagfiles

This commit is contained in:
Luca 2021-05-03 19:04:04 +02:00
parent 564b8331fc
commit 7bb8282961
2 changed files with 6 additions and 6 deletions

View File

@ -10,7 +10,7 @@ namespace Wabbajack.Lib.CompilationSteps
{ {
public class IgnoreTaggedFiles : ACompilationStep public class IgnoreTaggedFiles : ACompilationStep
{ {
private readonly List<AbsolutePath> _ignoreList = new List<AbsolutePath>(); private List<AbsolutePath> _ignoreList = new List<AbsolutePath>();
private List<AbsolutePath> _tagFiles; private List<AbsolutePath> _tagFiles;
private readonly string _tag; private readonly string _tag;
private readonly ACompiler _aCompiler; private readonly ACompiler _aCompiler;
@ -24,7 +24,7 @@ namespace Wabbajack.Lib.CompilationSteps
_tag = tag; _tag = tag;
string rootDirectory = (string)_sourcePath; string rootDirectory = (string)_sourcePath;
_reason = $"Ignored because folder was tagged with {_tag}"; _reason = $"Ignored because folder/file was tagged with {_tag}";
_tagFiles = Directory.EnumerateFiles(rootDirectory, _tag, SearchOption.AllDirectories) _tagFiles = Directory.EnumerateFiles(rootDirectory, _tag, SearchOption.AllDirectories)
.Select(str => (AbsolutePath)str) .Select(str => (AbsolutePath)str)
@ -48,7 +48,7 @@ namespace Wabbajack.Lib.CompilationSteps
{ {
foreach (var folderpath in _ignoreList) foreach (var folderpath in _ignoreList)
{ {
if (!source.AbsolutePath.InFolder(folderpath)) continue; if (!source.AbsolutePath.Equals(folderpath) || !source.AbsolutePath.InFolder(folderpath)) continue;
var result = source.EvolveTo<IgnoredDirectly>(); var result = source.EvolveTo<IgnoredDirectly>();
result.Reason = _reason; result.Reason = _reason;
return result; return result;

View File

@ -10,7 +10,7 @@ namespace Wabbajack.Lib.CompilationSteps
{ {
public class IncludeTaggedFiles : ACompilationStep public class IncludeTaggedFiles : ACompilationStep
{ {
private readonly List<AbsolutePath> _includeDirectly = new List<AbsolutePath>(); private List<AbsolutePath> _includeDirectly = new List<AbsolutePath>();
private List<AbsolutePath> _tagFiles; private List<AbsolutePath> _tagFiles;
private readonly string _tag; private readonly string _tag;
private readonly ACompiler _aCompiler; private readonly ACompiler _aCompiler;
@ -45,7 +45,7 @@ namespace Wabbajack.Lib.CompilationSteps
{ {
foreach (var folderpath in _includeDirectly) foreach (var folderpath in _includeDirectly)
{ {
if (!source.AbsolutePath.InFolder(folderpath)) continue; if (!source.AbsolutePath.Equals(folderpath) || !source.AbsolutePath.InFolder(folderpath)) continue;
var result = source.EvolveTo<InlineFile>(); var result = source.EvolveTo<InlineFile>();
result.SourceDataID = await _compiler.IncludeFile(source.AbsolutePath); result.SourceDataID = await _compiler.IncludeFile(source.AbsolutePath);
return result; return result;