ClearWorkshop small changes

This commit is contained in:
timerix 2023-03-18 06:28:15 +06:00
parent e79790d7de
commit 71bef3da32
4 changed files with 15 additions and 9 deletions

View File

@ -15,6 +15,6 @@
<ProjectReference Include="..\..\DTLib\DTLib\DTLib.csproj" />
</ItemGroup>
<ItemGroup Condition=" '$(Configuration)' != 'Debug' ">
<PackageReference Include="DTLib" Version="1.1.6" />
<PackageReference Include="DTLib" Version="1.1.7" />
</ItemGroup>
</Project>

View File

@ -10,6 +10,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "solution_files", "solution_
.gitignore = .gitignore
nuget.config = nuget.config
publish_native.sh = publish_native.sh
publish_debug.sh = publish_debug.sh
README.md = README.md
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DTLib", "..\DTLib\DTLib\DTLib.csproj", "{67E226B7-F04B-4FB1-A9AA-E4AE3A5A8A3F}"

View File

@ -20,11 +20,10 @@ static class Workshop
for (int i = 0; i < moddirs.Length; i++)
{
string modId = moddirs[i].LastName().ToString();
IOPath modZip="";
if (Directory.GetFiles(moddirs[i], "*.zip").Length != 0)
modZip = Directory.GetFiles(moddirs[i], "*.zip")[0];
if (modZip.Length != 0)
var zips = Directory.GetFiles(moddirs[i], "*.zip");
if (zips.Length > 0)
{
var modZip = zips[0];
Log("y", $"archive found: {modZip}");
if (Directory.Exists("_UNZIP")) Directory.Delete("_UNZIP");
var pr = new Process();
@ -32,7 +31,7 @@ static class Workshop
pr.StartInfo.UseShellExecute = false;
pr.StartInfo.FileName = "7z";
pr.StartInfo.Arguments = $"x -y -o_UNZIP \"{modZip}\"";
Log("h",$"{pr.StartInfo.WorkingDirectory}$: {pr.StartInfo.FileName} {pr.StartInfo.Arguments}");
Log("h",$"{pr.StartInfo.FileName} {pr.StartInfo.Arguments}");
pr.Start();
pr.WaitForExit();
moddirs[i] = "_UNZIP";
@ -78,7 +77,12 @@ static class Workshop
Directory.Copy(Path.Concat(moddirs[i], subdirs[n]),
Path.Concat(outModDir, subdirs[n]),
true, out var _conflicts);
Log("y", $"found {_conflicts.Count} conflicts:\n{_conflicts.MergeToString('\n')}");
if (_conflicts.Count != 0)
{
Log("r", $"found {_conflicts.Count} conflicts:\n{_conflicts.MergeToString('\n')}");
return;
}
break;
}
}
@ -97,7 +101,7 @@ static class Workshop
string desc = await DownloadModDescription(workshopId);
var file = Path.Concat(outDir, $"desc_{workshopId}.txt");
File.WriteAllText(file, desc);
Log("g", $"downloaded {workshopId} description to {file}");
Log("h", $"downloaded {workshopId} description to {file}");
}
catch (Exception e)
{

View File

@ -19,7 +19,7 @@
<ProjectReference Include="..\..\DTLib\DTLib\DTLib.csproj" />
</ItemGroup>
<ItemGroup Condition=" '$(Configuration)' != 'Debug' ">
<PackageReference Include="DTLib" Version="1.1.6" />
<PackageReference Include="DTLib" Version="1.1.7" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\diff-text\diff-text.csproj" />