Skip to content

Commit

Permalink
Merge pull request #3055 from sgkoishi/pr3055
Browse files Browse the repository at this point in the history
Fix #2895
  • Loading branch information
hakusaro authored Jan 26, 2025
2 parents 74a0715 + 5da5f35 commit c6dfb97
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions TShockPluginManager/Nuget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ You should have received a copy of the GNU General Public License

namespace TShockPluginManager
{

public class Nugetter
{
// this object can figure out the right framework folders to use from a set of packages
Expand Down Expand Up @@ -82,15 +81,13 @@ async Task GetPackageDependencies(
// make sure the source repository can actually tell us about dependencies
var dependencyInfoResource = await sourceRepository.GetResourceAsync<DependencyInfoResource>();
// get the try and dependencies
// (the above function returns a nullable value, but doesn't properly indicate it as such)
#pragma warning disable CS8602
var dependencyInfo = await dependencyInfoResource?.ResolvePackage(
if (dependencyInfoResource is null) continue;
var dependencyInfo = await dependencyInfoResource.ResolvePackage(
package, framework, cacheContext, logger, CancellationToken.None);
#pragma warning restore CS8602

// oop, we don't have the ability to get dependency info from this repository, or
// it wasn't found. let's try the next source repository!
if (dependencyInfo == null) continue;
if (dependencyInfo is null) continue;

availablePackages.Add(dependencyInfo);
foreach (var dependency in dependencyInfo.Dependencies)
Expand Down Expand Up @@ -302,8 +299,11 @@ public void InstallPackage(SourcePackageDependencyInfo pkg, string pkgPath, Pack

var relativeFolder = Path.GetDirectoryName(packageRelativeFilePath);
var targetFolder = Path.Join(isPlugin ? "./ServerPlugins" : "./bin", relativeFolder);
Directory.CreateDirectory(targetFolder);
File.Copy(filePath, Path.Join(targetFolder, Path.GetFileName(filePath)), true);
if (File.Exists(filePath))
{
Directory.CreateDirectory(targetFolder);
File.Copy(filePath, Path.Join(targetFolder, Path.GetFileName(filePath)), true);
}
}
}
}
Expand Down

0 comments on commit c6dfb97

Please sign in to comment.