Skip to content

Commit

Permalink
removing dotnet requirement for apps that have bundles configured
Browse files Browse the repository at this point in the history
  • Loading branch information
soninaren authored and ahmelsayed committed Sep 20, 2019
1 parent 141331c commit 739c74b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Linq;
using System.Threading.Tasks;
using Azure.Functions.Cli.Common;
using Azure.Functions.Cli.ExtensionBundle;
using Azure.Functions.Cli.Helpers;
using Azure.Functions.Cli.Interfaces;
using Azure.Functions.Cli.Telemetry;
Expand Down Expand Up @@ -156,7 +157,13 @@ public async override Task RunAsync()
else
{
TelemetryHelpers.AddCommandEventToDictionary(TelemetryCommandEvents, "template", TemplateName);
ExtensionsHelper.EnsureDotNetForExtensions(template);

var extensionBundleManager = ExtensionBundleHelper.GetExtensionBundleManager();
if (template.Metadata.Extensions != null && !extensionBundleManager.IsExtensionBundleConfigured() && !CommandChecker.CommandExists("dotnet"))
{
throw new CliException($"The {template.Metadata.Name} template has extensions. {Constants.Errors.ExtensionsNeedDotnet}");
}

ColoredConsole.Write($"Function name: [{template.Metadata.DefaultFunctionName}] ");
FunctionName = FunctionName ?? Console.ReadLine();
FunctionName = string.IsNullOrEmpty(FunctionName) ? template.Metadata.DefaultFunctionName : FunctionName;
Expand Down
7 changes: 0 additions & 7 deletions src/Azure.Functions.Cli/Helpers/ExtensionsHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,5 @@ public static IEnumerable<ExtensionPackage> GetExtensionPackages()
return packages.Values;
}

public static void EnsureDotNetForExtensions(Template template)
{
if (template.Metadata.Extensions != null && !CommandChecker.CommandExists("dotnet"))
{
throw new CliException($"The {template.Metadata.Name} template has extensions. {Constants.Errors.ExtensionsNeedDotnet}");
}
}
}
}

0 comments on commit 739c74b

Please sign in to comment.