Skip to content

Commit

Permalink
Merge branch 'develop' into rmarusyk/2932
Browse files Browse the repository at this point in the history
  • Loading branch information
Marusyk authored Jan 29, 2021
2 parents a2661d7 + f52d6a2 commit 3d7b5fc
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!--
BEFORE YOU SUBMIT AN ISSUE:
DO NOT CREATE AN ISSUE FOR A QUESTION - questions are better served in chat, and can be later raised as an issue if required.
- chat - https://gitter.im/cake-build/cake
DO NOT CREATE AN ISSUE FOR A QUESTION - questions are better served in discussions, and can be later raised as an issue if required.
- discussions - https://github.com/cake-build/cake/discussions
DELETE EVERYTHING IN THIS COMMENT BLOCK
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ Any new code should also have reasonable unit test coverage.
## Contributing process
### Get buyoff or find open community issues or features

* Through GitHub, or through the [Gitter chat](https://gitter.im/cake-build/cake) (preferred),
* Through GitHub, or through the [GitHub discussions](https://github.com/cake-build/cake/discussions) (preferred),
you talk about a feature you would like to see (or a bug), and why it should be in Cake.
* If approved through the Gitter chat, ensure an accompanying GitHub issue is created with
* If approved through the GitHub discussions, ensure an accompanying GitHub issue is created with
information and a link back to the discussion.
* Once you get a nod from one of the [Cake Team](https://github.com/cake-build?tab=members), you can start on the feature.
* Alternatively, if a feature is on the issues list with the
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Make sure you've read the [contribution guidelines](https://cakebuild.net/docs/c

[![Follow @cakebuildnet](https://img.shields.io/badge/Twitter-Follow%20%40cakebuildnet-blue.svg)](https://twitter.com/intent/follow?screen_name=cakebuildnet)

[![Join the chat at https://gitter.im/cake-build/cake](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/cake-build/cake?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Join the chat at https://github.com/cake-build/cake/discussions](https://img.shields.io/badge/discussions-join%20chat-brightgreen)](https://github.com/cake-build/cake/discussions?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

## License

Expand Down
7 changes: 7 additions & 0 deletions src/Cake.Core/Diagnostics/Console/AnsiDetector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ static AnsiDetector()

public static bool SupportsAnsi(ICakeEnvironment environment)
{
// Prevents the addition of ANSI color if NO_COLOR env. variable is present
// https://no-color.org
if (!string.IsNullOrWhiteSpace(environment.GetEnvironmentVariable("NO_COLOR")))
{
return false;
}

// Github action doesn't setup a correct PTY but supports ANSI.
if (!string.IsNullOrWhiteSpace(environment.GetEnvironmentVariable("GITHUB_ACTION")))
{
Expand Down
40 changes: 40 additions & 0 deletions src/Cake.Core/IO/IRegistry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,52 @@ namespace Cake.Core.IO
/// </summary>
public interface IRegistry
{
/// <summary>
/// Gets a registry key representing HKEY_CURRENT_USER.
/// </summary>
/// <value>
/// A registry key representing HKEY_CURRENT_USER.
/// </value>
IRegistryKey CurrentUser { get; }

/// <summary>
/// Gets a registry key representing HKEY_LOCAL_MACHINE.
/// </summary>
/// <value>
/// A registry key representing HKEY_LOCAL_MACHINE.
/// </value>
IRegistryKey LocalMachine { get; }

/// <summary>
/// Gets a registry key representing HKEY_CLASSES_ROOT.
/// </summary>
/// <value>
/// A registry key representing HKEY_CLASSES_ROOT.
/// </value>
IRegistryKey ClassesRoot { get; }

/// <summary>
/// Gets a registry key representing HKEY_USERS.
/// </summary>
/// <value>
/// A registry key representing HKEY_USERS.
/// </value>
IRegistryKey Users { get; }

/// <summary>
/// Gets a registry key representing HKEY_PERFORMANCE_DATA.
/// </summary>
/// <value>
/// A registry key representing HKEY_PERFORMANCE_DATA.
/// </value>
IRegistryKey PerformanceData { get; }

/// <summary>
/// Gets a registry key representing HKEY_CURRENT_CONFIG.
/// </summary>
/// <value>
/// A registry key representing HKEY_CURRENT_CONFIG.
/// </value>
IRegistryKey CurrentConfig { get; }
}
}
15 changes: 15 additions & 0 deletions src/Cake.Core/IO/WindowsRegistry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,22 @@ namespace Cake.Core.IO
/// </summary>
public sealed class WindowsRegistry : IRegistry
{
/// <inheritdoc/>
public IRegistryKey CurrentUser => new WindowsRegistryKey(Microsoft.Win32.Registry.CurrentUser);

/// <inheritdoc/>
public IRegistryKey LocalMachine => new WindowsRegistryKey(Microsoft.Win32.Registry.LocalMachine);

/// <inheritdoc/>
public IRegistryKey ClassesRoot => new WindowsRegistryKey(Microsoft.Win32.Registry.ClassesRoot);

/// <inheritdoc/>
public IRegistryKey Users => new WindowsRegistryKey(Microsoft.Win32.Registry.Users);

/// <inheritdoc/>
public IRegistryKey PerformanceData => new WindowsRegistryKey(Microsoft.Win32.Registry.PerformanceData);

/// <inheritdoc/>
public IRegistryKey CurrentConfig => new WindowsRegistryKey(Microsoft.Win32.Registry.CurrentConfig);
}
}

0 comments on commit 3d7b5fc

Please sign in to comment.