Skip to content

Commit

Permalink
rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
corbob committed Nov 4, 2024
1 parent ff7f4cf commit 96b72c5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
16 changes: 10 additions & 6 deletions src/chocolatey/infrastructure.app/services/NugetService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -359,12 +359,16 @@ Package url{6}
var failedPackages = string.Join(", ", decryptionFailures.Select(f => "{0} - {1}".FormatWith(f.Package.Id, f.Package.Version)));
var failureMessage = "There were some failures decrypting package arguments.";
var failedPackagesMessage = "Failed packages: {0}".FormatWith(failedPackages);
this.Log().Warn(config.RegularOutput ?
ChocolateyLoggers.Normal :
ChocolateyLoggers.LogFileOnly, failureMessage);
this.Log().Warn(config.RegularOutput ?
ChocolateyLoggers.Normal :
ChocolateyLoggers.LogFileOnly, failedPackagesMessage);
if (config.RegularOutput)
{
this.Log().Warn(failureMessage);
this.Log().Warn(failedPackagesMessage);
}
else
{
this.Log().Debug(failureMessage);
this.Log().Debug(failedPackagesMessage);
}
}
}

Expand Down
13 changes: 6 additions & 7 deletions src/chocolatey/infrastructure.app/utility/ArgumentsUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,17 +102,16 @@ public static IEnumerable<string> DecryptPackageArgumentsFile(
{
var firstMessage = "There was an error attempting to decrypt the contents of the .arguments file for version '{0}' of package '{1}'. See log file for more information.".FormatWith(version, id);
var secondMessage = "We failed to decrypt '{0}'. Error from decryption:{1} '{2}'".FormatWith(argumentsFile, Environment.NewLine, ex.Message);
"chocolatey".Log().Error(throwOnFailure ?
logging.ChocolateyLoggers.Normal :
logging.ChocolateyLoggers.LogFileOnly, firstMessage);
"chocolatey".Log().Error(throwOnFailure ?
logging.ChocolateyLoggers.Normal :
logging.ChocolateyLoggers.LogFileOnly, secondMessage);


if (throwOnFailure)
{
"chocolatey".Log().Error(firstMessage);
"chocolatey".Log().Error(secondMessage);
throw;
}

"chocolatey".Log().Debug(firstMessage);
"chocolatey".Log().Debug(secondMessage);
}

// Lets do a global check first to see if there are any sensitive arguments
Expand Down

0 comments on commit 96b72c5

Please sign in to comment.