Skip to content

Commit

Permalink
VCI-162: Fix user input comparing (#21)
Browse files Browse the repository at this point in the history
* VCI-162: Fix user input comparing

* VCI-162: Make WebProject static

* VCI-162: Fix codesmells
  • Loading branch information
krankenbro authored Sep 22, 2021
1 parent a31f30f commit 81c5966
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Build.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Net.Http;
Expand Down Expand Up @@ -220,11 +221,11 @@ public static int Main(string[] args)
protected static AbsolutePath SamplesDirectory => RootDirectory / "samples";

protected AbsolutePath ModulesLocalDirectory => ArtifactsDirectory / ModulesJsonDirectoryName;
protected Project WebProject => Solution?.AllProjects.FirstOrDefault(x => x.Name.EndsWith(".Web") || x.Name.EndsWith("VirtoCommerce.Storefront") || x.Name.EndsWith("_build"));
protected AbsolutePath ModuleManifestFile => WebProject?.Directory / "module.manifest";
protected static Project WebProject => Solution?.AllProjects.FirstOrDefault(x => x.Name.EndsWith(".Web") || x.Name.EndsWith("VirtoCommerce.Storefront") || x.Name.EndsWith("_build"));
protected static AbsolutePath ModuleManifestFile => WebProject?.Directory / "module.manifest";
protected AbsolutePath ModuleIgnoreFile => RootDirectory / "module.ignore";

protected Microsoft.Build.Evaluation.Project MSBuildProject => WebProject?.GetMSBuildProject();
protected static Microsoft.Build.Evaluation.Project MSBuildProject => WebProject?.GetMSBuildProject();
protected string VersionPrefix => IsTheme ? GetThemeVersion(PackageJsonPath) : MSBuildProject.GetProperty("VersionPrefix")?.EvaluatedValue;
protected string VersionSuffix => MSBuildProject?.GetProperty("VersionSuffix")?.EvaluatedValue;
protected string ReleaseVersion => MSBuildProject?.GetProperty("PackageVersion")?.EvaluatedValue ?? WebProject.GetProperty("Version");
Expand Down Expand Up @@ -503,10 +504,10 @@ private string GetThemeVersion(string packageJsonPath)

if (disableApproval.IsNullOrEmpty() && !Force)
{
Console.Write($"Are you sure you want to release {GitRepository.Identifier}? (Y/N): ");
Console.Write($"Are you sure you want to release {GitRepository.Identifier}? (y/N): ");
var response = Console.ReadLine();

if (response.EqualsInvariant("y"))
if (string.Compare(response, "y", true, CultureInfo.InvariantCulture) != 0)
{
ControlFlow.Fail("Aborted");
}
Expand Down

0 comments on commit 81c5966

Please sign in to comment.