Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(maint) Add ability for Agent debugging #3412

Merged
merged 1 commit into from
Apr 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading