Skip to content

Commit

Permalink
(GH-785) Reverted StyleCop change
Browse files Browse the repository at this point in the history
Otherwise, the filesystem variable is never initialized, and therefore
can't be used.
  • Loading branch information
gep13 committed Jul 13, 2020
1 parent 027bb1c commit fc690e0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions Source/ChocolateyGui.Common.Windows/Bootstrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ namespace ChocolateyGui.Common.Windows
{
public class Bootstrapper : BootstrapperBase
{
private static readonly IFileSystem _fileSystem = new DotNetFileSystem();

#pragma warning disable SA1202
public static readonly string ChocolateyGuiInstallLocation = _fileSystem.get_directory_name(_fileSystem.get_current_assembly_path());
public static readonly string ChocolateyInstallEnvironmentVariableName = "ChocolateyInstall";
public static readonly string ChocolateyInstallLocation = System.Environment.GetEnvironmentVariable(ChocolateyInstallEnvironmentVariableName) ?? _fileSystem.get_directory_name(_fileSystem.get_current_assembly_path());
Expand All @@ -50,8 +53,7 @@ public class Bootstrapper : BootstrapperBase
public static readonly string Name = "Chocolatey GUI";

public static readonly string LicensedChocolateyGuiAssemblySimpleName = "chocolateygui.licensed";

private static readonly IFileSystem _fileSystem = new DotNetFileSystem();
#pragma warning restore SA1202

public Bootstrapper()
{
Expand Down
6 changes: 4 additions & 2 deletions Source/ChocolateyGuiCli/Bootstrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ namespace ChocolateyGuiCli
{
public static class Bootstrapper
{
private static readonly IFileSystem _fileSystem = new DotNetFileSystem();

#pragma warning disable SA1202
public static readonly string ChocolateyGuiInstallLocation = _fileSystem.get_directory_name(_fileSystem.get_current_assembly_path());
public static readonly string ChocolateyInstallEnvironmentVariableName = "ChocolateyInstall";
public static readonly string ChocolateyInstallLocation = System.Environment.GetEnvironmentVariable(ChocolateyInstallEnvironmentVariableName) ?? _fileSystem.get_directory_name(_fileSystem.get_current_assembly_path());
Expand All @@ -35,8 +38,7 @@ public static class Bootstrapper
public static readonly string Name = "Chocolatey GUI";

public static readonly string LicensedChocolateyGuiAssemblySimpleName = "chocolateygui.licensed";

private static readonly IFileSystem _fileSystem = new DotNetFileSystem();
#pragma warning restore SA1202

internal static ILogger Logger { get; private set; }

Expand Down

0 comments on commit fc690e0

Please sign in to comment.