Skip to content

Commit

Permalink
Merge pull request #3412 from corbob/Debugging-Changes
Browse files Browse the repository at this point in the history
(maint) Add ability for Agent debugging
  • Loading branch information
gep13 authored Apr 5, 2024
2 parents 8d024e8 + 7eac698 commit c439ad3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion recipe.cake
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ Task("Prepare-Chocolatey-Packages")
// Run Chocolatey Unpackself
CopyFile(BuildParameters.Paths.Directories.PublishedApplications + "/choco_merged/choco.exe", BuildParameters.Paths.Directories.ChocolateyNuspecDirectory + "/tools/chocolateyInstall/choco.exe");
StartProcess(BuildParameters.Paths.Directories.ChocolateyNuspecDirectory + "/tools/chocolateyInstall/choco.exe", new ProcessSettings{ Arguments = "unpackself -f -y --allow-unofficial-build" });
StartProcess(BuildParameters.Paths.Directories.ChocolateyNuspecDirectory + "/tools/chocolateyInstall/choco.exe", new ProcessSettings{ Arguments = "unpackself -f -y --allow-unofficial-build --run-actual" });
// Tidy up logs and config folder which are not required
var logsDirectory = BuildParameters.Paths.Directories.ChocolateyNuspecDirectory + "/tools/chocolateyInstall/logs";
Expand Down
7 changes: 6 additions & 1 deletion src/chocolatey.console/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,12 @@ private static void Main(string[] args)
#if DEBUG
"chocolatey".Log().Info(() => "Exiting with {0}".FormatWith(Environment.ExitCode));
#endif
PauseIfDebug();
// Chocolatey Agent runs Chocolatey CLI with --run-actual. If that's the case we don't want to pause on debug.
if (!args.Any(a => a.IsEqualTo("--run-actual")))
{
PauseIfDebug();
}

Bootstrap.Shutdown();
Environment.Exit(Environment.ExitCode);
}
Expand Down

0 comments on commit c439ad3

Please sign in to comment.