Skip to content

Commit

Permalink
Merge branch 'stable'
Browse files Browse the repository at this point in the history
* stable:
  (GH-249) Fix "operation completed successfully" on stderr
  (maint) ApplicationParameters are readonly
  (maint) remove spec logging
  • Loading branch information
ferventcoder committed Jun 13, 2015
2 parents 72cf0d8 + 9936876 commit 28eb680
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ public override void Context()
_contextPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "infrastructure", "filesystem");
_theLockedFile = Path.Combine(_contextPath, "Slipsum.txt");
_packageResult = new PackageResult("bob", "1.2.3", FileSystem.get_directory_name(_theLockedFile));
MockLogger.LogMessagesToConsole = true;

_fileStream = new FileStream(_theLockedFile, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None);
}
Expand Down
4 changes: 2 additions & 2 deletions src/chocolatey/infrastructure.app/ApplicationParameters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ public static class Environment

public static readonly string[] ConfigFileExtensions = new string[] {".autoconf",".config",".conf",".cfg",".jsc",".json",".jsonp",".ini",".xml",".yaml"};

public static string HashProviderFileTooBig = "UnableToDetectChanges_FileTooBig";
public static string HashProviderFileLocked = "UnableToDetectChanges_FileLocked";
public static readonly string HashProviderFileTooBig = "UnableToDetectChanges_FileTooBig";
public static readonly string HashProviderFileLocked = "UnableToDetectChanges_FileLocked";

public static class Tools
{
Expand Down
17 changes: 15 additions & 2 deletions src/chocolatey/infrastructure.app/services/PowershellService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public class PowershellService : IPowershellService
{
private readonly IFileSystem _fileSystem;
private readonly string _customImports;
private const string OPERATION_COMPLETED_SUCCESSFULLY = "The operation completed successfully.";

public PowershellService(IFileSystem fileSystem)
: this(fileSystem, new CustomString(string.Empty))
Expand Down Expand Up @@ -269,10 +270,22 @@ public bool run_action(ChocolateyConfiguration configuration, PackageResult pack
(s, e) =>
{
if (string.IsNullOrWhiteSpace(e.Data)) return;
failure = true;
this.Log().Error(() => " " + e.Data);
if (e.Data.is_equal_to(OPERATION_COMPLETED_SUCCESSFULLY))
{
this.Log().Info(() => " " + e.Data);
}
else
{
failure = true;
this.Log().Error(() => " " + e.Data);
}
});

if (exitCode != 0)
{
failure = true;
}

if (failure)
{
Environment.ExitCode = exitCode;
Expand Down

0 comments on commit 28eb680

Please sign in to comment.