-
-
Notifications
You must be signed in to change notification settings - Fork 512
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding Enricher for Azure Pipelines (#1675)
- Loading branch information
Showing
2 changed files
with
21 additions
and
0 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
src/Spectre.Console/Enrichment/CI/AzurePipelinesEnricher.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
namespace Spectre.Console.Enrichment; | ||
|
||
internal sealed class AzurePipelinesEnricher : IProfileEnricher | ||
{ | ||
public string Name => "AzurePipeline"; | ||
|
||
public bool Enabled(IDictionary<string, string> environmentVariables) | ||
{ | ||
environmentVariables.TryGetValue("TF_BUILD", out var environmentValue); | ||
return !string.IsNullOrWhiteSpace(environmentValue); | ||
} | ||
|
||
public void Enrich(Profile profile) | ||
{ | ||
profile.Capabilities.Ansi = true; | ||
profile.Capabilities.Legacy = false; | ||
profile.Capabilities.Interactive = false; | ||
profile.Capabilities.Links = false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters