Skip to content

Commit

Permalink
VCI-772: Fix codesmells
Browse files Browse the repository at this point in the history
  • Loading branch information
krankenbro committed Feb 21, 2024
1 parent e190dd9 commit a5a50f7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/VirtoCommerce.Build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,7 @@ private static void CreateNukeDirectory()

var nukeFiles = Directory.GetFiles(currentDirectory, ".nuke");

if (!nukeFiles.Any() && !Directory.Exists(Path.Join(currentDirectory, ".nuke")))
if (nukeFiles.Length == 0 && !Directory.Exists(Path.Join(currentDirectory, ".nuke")))
{
Console.WriteLine("No .nuke file found!");
var solutions = Directory.GetFiles(currentDirectory, "*.sln");
Expand All @@ -857,7 +857,7 @@ private static void CreateNukeDirectory()
CreateDotNuke(currentDirectory);
}
}
else if (nukeFiles.Any())
else if (nukeFiles.Length > 0)
{
var nukeFile = nukeFiles[0];
ConvertDotNukeFile(nukeFile);
Expand Down Expand Up @@ -1202,7 +1202,7 @@ private static void CleanSolution(string[] searchPattern, AbsolutePath[] ignoreP
{
if (SourceDirectory.DirectoryExists())
{
if (ignorePaths?.Any() == true)
if (ignorePaths?.Length > 0)
{
SourceDirectory
.GlobDirectories(searchPattern)
Expand Down
2 changes: 1 addition & 1 deletion src/VirtoCommerce.Build/Cloud/Build.SaaS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ private void SaveCloudToken(string token)
public Target CloudUp => _ => _
.DependsOn(CloudInit, CloudDeploy);

private static ISaaSDeploymentApi CreateVirtocloudClient(string url, string token)
private static SaaSDeploymentApi CreateVirtocloudClient(string url, string token)
{
var config = new VirtoCloud.Client.Client.Configuration();
config.BasePath = url;
Expand Down
5 changes: 4 additions & 1 deletion src/VirtoCommerce.Build/Extensions/PathExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ public static class PathExtension
{
public static AbsolutePath ToAbsolutePath(this string path)
{
if(path == null) return null;
if(path == null)
{
return null;
}

return AbsolutePath.Create(Path.GetFullPath(path));
}
Expand Down

0 comments on commit a5a50f7

Please sign in to comment.