Fix #2895
This commit is contained in:
parent
846ccb46bd
commit
52ed275be2
1 changed files with 8 additions and 8 deletions
|
|
@ -30,7 +30,6 @@ using NuGet.Versioning;
|
||||||
|
|
||||||
namespace TShockPluginManager
|
namespace TShockPluginManager
|
||||||
{
|
{
|
||||||
|
|
||||||
public class Nugetter
|
public class Nugetter
|
||||||
{
|
{
|
||||||
// this object can figure out the right framework folders to use from a set of packages
|
// this object can figure out the right framework folders to use from a set of packages
|
||||||
|
|
@ -82,15 +81,13 @@ namespace TShockPluginManager
|
||||||
// make sure the source repository can actually tell us about dependencies
|
// make sure the source repository can actually tell us about dependencies
|
||||||
var dependencyInfoResource = await sourceRepository.GetResourceAsync<DependencyInfoResource>();
|
var dependencyInfoResource = await sourceRepository.GetResourceAsync<DependencyInfoResource>();
|
||||||
// get the try and dependencies
|
// get the try and dependencies
|
||||||
// (the above function returns a nullable value, but doesn't properly indicate it as such)
|
if (dependencyInfoResource is null) continue;
|
||||||
#pragma warning disable CS8602
|
var dependencyInfo = await dependencyInfoResource.ResolvePackage(
|
||||||
var dependencyInfo = await dependencyInfoResource?.ResolvePackage(
|
|
||||||
package, framework, cacheContext, logger, CancellationToken.None);
|
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
|
// 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!
|
// it wasn't found. let's try the next source repository!
|
||||||
if (dependencyInfo == null) continue;
|
if (dependencyInfo is null) continue;
|
||||||
|
|
||||||
availablePackages.Add(dependencyInfo);
|
availablePackages.Add(dependencyInfo);
|
||||||
foreach (var dependency in dependencyInfo.Dependencies)
|
foreach (var dependency in dependencyInfo.Dependencies)
|
||||||
|
|
@ -302,8 +299,11 @@ namespace TShockPluginManager
|
||||||
|
|
||||||
var relativeFolder = Path.GetDirectoryName(packageRelativeFilePath);
|
var relativeFolder = Path.GetDirectoryName(packageRelativeFilePath);
|
||||||
var targetFolder = Path.Join(isPlugin ? "./ServerPlugins" : "./bin", relativeFolder);
|
var targetFolder = Path.Join(isPlugin ? "./ServerPlugins" : "./bin", relativeFolder);
|
||||||
Directory.CreateDirectory(targetFolder);
|
if (File.Exists(filePath))
|
||||||
File.Copy(filePath, Path.Join(targetFolder, Path.GetFileName(filePath)), true);
|
{
|
||||||
|
Directory.CreateDirectory(targetFolder);
|
||||||
|
File.Copy(filePath, Path.Join(targetFolder, Path.GetFileName(filePath)), true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue