diff options
author | Matt Ward <matt.ward@microsoft.com> | 2019-12-12 14:04:17 +0300 |
---|---|---|
committer | Matt Ward <ward.matt@gmail.com> | 2020-01-15 19:01:33 +0300 |
commit | 1c2c042a17a46e36167809ed9ec83ed47018377d (patch) | |
tree | e4280745cd7b6c3aa5355cdbc08d1837bf96417f /main/src | |
parent | c184d75660dd662d53cd741d0f52459e8f6b2506 (diff) |
[NuGet] Allow license acceptance dialog to be disabled
Added a feature switch to allow the license acceptance dialog
to be disabled. This can be done by setting the environment
variable:
MD_FEATURES_DISABLED=NuGetLicenseAcceptanceDialog
By default the license acceptance dialog will be displayed. The
feature switch can be used by automation tests to disable the
dialog and the license acceptance for the NuGet package will
occur without the user being prompted.
Fixes VSTS #1036006 - Disable license acceptance dialog with
feature switch
Diffstat (limited to 'main/src')
-rw-r--r-- | main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/LicenseAcceptanceService.cs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/LicenseAcceptanceService.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/LicenseAcceptanceService.cs index bd66949c15..57d8994914 100644 --- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/LicenseAcceptanceService.cs +++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/LicenseAcceptanceService.cs @@ -29,6 +29,7 @@ using System.Collections.Generic;
using System.Threading.Tasks;
using MonoDevelop.Core;
+using MonoDevelop.Core.FeatureConfiguration; using MonoDevelop.Ide;
namespace MonoDevelop.PackageManagement
@@ -37,6 +38,9 @@ namespace MonoDevelop.PackageManagement {
public Task<bool> AcceptLicenses (IEnumerable<NuGetPackageLicense> licenses)
{
+ if (FeatureSwitchService.IsFeatureEnabled ("NuGetLicenseAcceptanceDialog") == false)
+ return Task.FromResult (true);
+
if (Runtime.IsMainThread)
return ShowLicenseAcceptanceDialog (licenses);
|