Skip to content

Commit

Permalink
Simplify and deduplicate Tool declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
IT-VBFK committed Jan 6, 2023
1 parent 8439ac1 commit c270a03
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions Build/Build.cs
Expand Up @@ -49,16 +49,19 @@ class Build : NukeBuild
Tool NSpec3;

#if OS_WINDOWS
[PackageExecutable("Node.js.redist", "node.exe", Version = "16.17.1", Framework = "win-x64")]
Tool Node;
const string NodeFramework = "win-x64";
const string NodeExecutable = "node.exe";
#elif OS_MAC
[PackageExecutable("Node.js.redist", "node", Version = "16.17.1", Framework = "osx-x64")]
Tool Node;
const string NodeFramework = "osx-x64";
const string NodeExecutable = "node";
#else
[PackageExecutable("Node.js.redist", "node", Version = "16.17.1", Framework = "linux-x64")]
Tool Node;
const string NodeFramework = "linux-x64";
const string NodeExecutable = "node";
#endif

[PackageExecutable("Node.js.redist", NodeExecutable, Version = "16.17.1", Framework = NodeFramework)]
Tool Node;

AbsolutePath ArtifactsDirectory => RootDirectory / "Artifacts";

AbsolutePath TestResultsDirectory => RootDirectory / "TestResults";
Expand Down Expand Up @@ -263,10 +266,8 @@ class Build : NukeBuild
.Executes(() =>
{
Node($"{YarnCli} install --silent", workingDirectory: RootDirectory);
Node($"{YarnCli} --silent run cspell --no-summary", workingDirectory: RootDirectory,
Node($"{YarnCli} --silent run cspell --no-summary", workingDirectory: RootDirectory,
customLogger: (_, msg) => Error(msg));
});


bool IsTag => BranchSpec != null && BranchSpec.Contains("refs/tags", StringComparison.InvariantCultureIgnoreCase);
}

0 comments on commit c270a03

Please sign in to comment.