Skip to content

Commit

Permalink
Merge pull request #53 from YumeChan-DT/develop
Browse files Browse the repository at this point in the history
3.0-rc3 - Minor fixes and enhancements
  • Loading branch information
SakuraIsayeki committed May 4, 2022
2 parents f33f917 + f223c4c commit 9de8905
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 7 deletions.
33 changes: 29 additions & 4 deletions src/YumeChan.Core/Services/Plugins/NugetPluginsFetcher.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#nullable enable
#nullable enable

using System;
using System.Collections.Generic;
Expand Down Expand Up @@ -270,12 +270,36 @@ private static void FlattenDownloadedPackageToDirectoryStructure(DirectoryInfo d
// Move all selected files to the target folder (if not present already).
foreach (FileInfo file in files.AsParallel())
{
if (!File.Exists(Path.Combine(targetFolder.FullName, file.Name)))
string targetFilePath = Path.Combine(targetFolder.FullName, file.Name);

if (!File.Exists(targetFilePath))
{
file.MoveTo(Path.Combine(targetFolder.FullName, file.Name));
file.MoveTo(targetFilePath);
}
}

// Get the content/wwwroot folder, and copy its contents to the target folder (preserving directory structure, creating folders as needed).
DirectoryInfo wwwrootFolder = new (Path.Combine(downloadFolder.FullName, "content", "wwwroot"));

if (wwwrootFolder.Exists)
{
foreach (FileInfo file in wwwrootFolder.GetFiles("*", SearchOption.AllDirectories))
{
FileInfo targetFile = new(Path.Combine(targetFolder.FullName, "wwwroot", file.FullName[(wwwrootFolder.FullName.Length + 1)..]));

if (!targetFile.Exists)
{
if (targetFile.Directory is { Exists: false })
{
Directory.CreateDirectory(targetFile.Directory.FullName);
}

file.MoveTo(targetFile.FullName);
}
}
}


// Delete the downloaded package (download folder).
downloadFolder.Delete(true);
}
Expand All @@ -295,7 +319,8 @@ private static void DeletePluginPackage(string pluginsDirectory, string packageN
/// </summary>
private static NuGetVersion? GetLocalPackageVersion(string pluginsDirectory, string packageName)
=> new DirectoryInfo(Path.Combine(pluginsDirectory, packageName)).Exists
&& FileVersionInfo.GetVersionInfo(Path.Combine(pluginsDirectory, packageName, $"{packageName}.dll")) is { } fileVersionInfo
&& new FileInfo(Path.Combine(pluginsDirectory, packageName, $"{packageName}.dll")) is { Exists: true } file
&& FileVersionInfo.GetVersionInfo(file.FullName) is { } fileVersionInfo
? new(fileVersionInfo.FileVersion)
: null;
}
Expand Down
2 changes: 1 addition & 1 deletion src/YumeChan.Core/YumeChan.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Version>3.0-rc2</Version>
<Version>3.0-rc3</Version>
<Authors>Sakura Akeno Isayeki</Authors>
<Company>Nodsoft Systems</Company>
<Product>Yume-Chan</Product>
Expand Down
2 changes: 2 additions & 0 deletions src/YumeChan.NetRunner/Pages/_Host.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
<script src="/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>

<script src="/js/site.js"></script>

<persist-component-state />
</body>
</html>

4 changes: 2 additions & 2 deletions src/YumeChan.NetRunner/YumeChan.NetRunner.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Version>3.0-rc2</Version>
<Version>3.0-rc3</Version>
<Authors>Sakura Akeno Isayeki</Authors>
<Company>Nodsoft Systems</Company>
<Product>Yume-Chan</Product>
Expand Down

0 comments on commit 9de8905

Please sign in to comment.