Skip to content

Commit 12a80dc

Browse files
committed
Address feedback
1 parent f682a87 commit 12a80dc

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

src/Cli/func/Actions/LocalActions/InitAction.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ private async Task InitFunctionAppProject()
220220
}
221221

222222
// If a configuration profile is provided, apply it and return
223-
if (await ApplyConfigurationProfileIfProvided())
223+
if (await TryApplyConfigurationProfileIfProvided())
224224
{
225225
return;
226226
}
@@ -667,23 +667,23 @@ private async Task ShowEolMessage()
667667
}
668668
}
669669

670-
private async Task<bool> ApplyConfigurationProfileIfProvided()
670+
private async Task<bool> TryApplyConfigurationProfileIfProvided()
671671
{
672672
if (string.IsNullOrEmpty(ConfigurationProfile))
673673
{
674674
return false;
675675
}
676676

677-
IConfigurationProfile configurationProfile = _configurationProfile.FirstOrDefault(p => p.Name == ConfigurationProfile);
678-
if (configurationProfile == null)
677+
IConfigurationProfile configurationProfile = _configurationProfile
678+
.FirstOrDefault(p => string.Equals(p.Name, ConfigurationProfile, StringComparison.OrdinalIgnoreCase));
679+
680+
if (configurationProfile is null)
679681
{
680-
var allProfiles = _configurationProfile.Select(p => p.Name);
681-
var supportedProfileNames = string.Join(", ", allProfiles.Where(p => p != null));
682-
var supportedMessage = allProfiles.Any()
683-
? $"Supported values: {supportedProfileNames}."
684-
: "No configuration profiles are currently registered.";
682+
var supportedProfiles = _configurationProfile
683+
.Select(p => p.Name)
684+
.ToList();
685685

686-
ColoredConsole.WriteLine(WarningColor($"Configuration profile '{ConfigurationProfile}' is not supported. {supportedMessage}"));
686+
ColoredConsole.WriteLine(WarningColor($"Configuration profile '{ConfigurationProfile}' is not supported. Supported values: {string.Join(", ", supportedProfiles)}"));
687687
return true;
688688
}
689689

src/Cli/func/ConfigurationProfiles/McpCustomHandlerConfigurationProfile.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public async Task ApplyAsync(WorkerRuntime workerRuntime, bool force = false)
2222
await ApplyLocalSettingsAsync(workerRuntime, force);
2323
}
2424

25-
public async Task ApplyHostJsonAsync(bool force)
25+
internal async Task ApplyHostJsonAsync(bool force)
2626
{
2727
bool changed = false;
2828
string baseHostJson;
@@ -76,7 +76,7 @@ public async Task ApplyHostJsonAsync(bool force)
7676
}
7777
}
7878

79-
public async Task ApplyLocalSettingsAsync(WorkerRuntime workerRuntime, bool force)
79+
internal async Task ApplyLocalSettingsAsync(WorkerRuntime workerRuntime, bool force)
8080
{
8181
bool changed = false;
8282
string baseLocalSettings;

0 commit comments

Comments
 (0)