forked from scriptcs/scriptcs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScriptCsPackageManager.cs
More file actions
26 lines (23 loc) · 1.2 KB
/
ScriptCsPackageManager.cs
File metadata and controls
26 lines (23 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
using System.Linq;
using System.Reflection;
using System.Runtime.Versioning;
using NuGet;
namespace ScriptCs.Hosting.Package
{
//needed to allow forcing framework version for installation as the InstallPackage method that accepts version is protected and all other overloads force version to null!
public class ScriptCsPackageManager : PackageManager
{
public ScriptCsPackageManager(IPackageRepository sourceRepository, string path) : base(sourceRepository, path)
{
}
public override void InstallPackage(IPackage package, bool ignoreDependencies, bool allowPrereleaseVersions)
{
base.InstallPackage(package, new FrameworkName(FrameworkUtils.FrameworkName), ignoreDependencies, allowPrereleaseVersions);
}
public override void InstallPackage(string packageId, SemanticVersion version, bool ignoreDependencies, bool allowPrereleaseVersions)
{
var package = PackageRepositoryHelper.ResolvePackage(SourceRepository, LocalRepository, packageId, version, allowPrereleaseVersions);
base.InstallPackage(package, new FrameworkName(FrameworkUtils.FrameworkName), ignoreDependencies, allowPrereleaseVersions);
}
}
}