mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Refractored the creation of meta files and fixed downloads being included in the modlist
This commit is contained in:
parent
05791f363b
commit
fa18a45ebc
40
Wabbajack.Lib/CompilationSteps/IgnoreVortex.cs
Normal file
40
Wabbajack.Lib/CompilationSteps/IgnoreVortex.cs
Normal file
@ -0,0 +1,40 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using Newtonsoft.Json;
|
||||
using Wabbajack.Common;
|
||||
|
||||
namespace Wabbajack.Lib.CompilationSteps
|
||||
{
|
||||
public class IgnoreVortex : ACompilationStep
|
||||
{
|
||||
private readonly VortexCompiler _vortex;
|
||||
|
||||
public IgnoreVortex(ACompiler compiler) : base(compiler)
|
||||
{
|
||||
_vortex = compiler._vortexCompiler;
|
||||
}
|
||||
|
||||
public override Directive Run(RawSourceFile source)
|
||||
{
|
||||
if (Path.GetDirectoryName(source.AbsolutePath) != _vortex.DownloadsFolder) return null;
|
||||
var result = source.EvolveTo<IgnoredDirectly>();
|
||||
result.Reason = "Ignored because it is a Vortex file";
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
public override IState GetState()
|
||||
{
|
||||
return new State();
|
||||
}
|
||||
|
||||
[JsonObject("IgnoreVortex")]
|
||||
public class State : IState
|
||||
{
|
||||
public ICompilationStep CreateStep(ACompiler compiler)
|
||||
{
|
||||
return new IgnoreVortex(compiler);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -308,8 +308,11 @@ namespace Wabbajack.Lib
|
||||
|
||||
private void CreateMetaFiles()
|
||||
{
|
||||
Utils.Log("Getting Nexus api_key, please click authorize if a browser window appears");
|
||||
var nexusClient = new NexusApiClient();
|
||||
|
||||
Directory.EnumerateFiles(DownloadsFolder, "*", SearchOption.TopDirectoryOnly)
|
||||
.Where(f => File.Exists(f) && (Path.GetExtension(f) == ".zip" || Path.GetExtension(f) == ".rar") && !File.Exists(f+".meta"))
|
||||
.Where(f => File.Exists(f) && Path.GetExtension(f) != ".meta" && !File.Exists(f+".meta"))
|
||||
.Do(f =>
|
||||
{
|
||||
Utils.Log($"Trying to create meta file for {Path.GetFileName(f)}");
|
||||
@ -320,8 +323,6 @@ namespace Wabbajack.Lib
|
||||
$"paused=false\n" +
|
||||
$"removed=false\n" +
|
||||
$"gameName={GameName}\n";
|
||||
Utils.Log("Getting Nexus api_key, please click authorize if a browser window appears");
|
||||
var nexusClient = new NexusApiClient();
|
||||
string hash;
|
||||
using(var md5 = MD5.Create())
|
||||
using (var stream = File.OpenRead(f))
|
||||
@ -429,6 +430,7 @@ namespace Wabbajack.Lib
|
||||
//new IncludePropertyFiles(this),
|
||||
new IncludeVortexDeployment(this),
|
||||
new IncludeRegex(this, "^*\\.meta"),
|
||||
new IgnoreVortex(this),
|
||||
|
||||
Game == Game.DarkestDungeon ? new IncludeRegex(this, "project\\.xml$") : null,
|
||||
|
||||
|
@ -89,6 +89,7 @@
|
||||
<Compile Include="CompilationSteps\IgnorePathContains.cs" />
|
||||
<Compile Include="CompilationSteps\IgnoreRegex.cs" />
|
||||
<Compile Include="CompilationSteps\IgnoreStartsWith.cs" />
|
||||
<Compile Include="CompilationSteps\IgnoreVortex.cs" />
|
||||
<Compile Include="CompilationSteps\IgnoreWabbajackInstallCruft.cs" />
|
||||
<Compile Include="CompilationSteps\IncludeAll.cs" />
|
||||
<Compile Include="CompilationSteps\IncludeAllConfigs.cs" />
|
||||
|
Loading…
Reference in New Issue
Block a user