fix: Misc cleanup fixes

This commit is contained in:
Abhisek Datta
2026-01-08 16:35:22 +05:30
parent eaeaff9cb8
commit cb081348fa
2 changed files with 4 additions and 7 deletions
+2 -5
View File
@@ -221,18 +221,15 @@ func (g *packageManagerGuard) continueExecution(ctx context.Context, pc *package
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
// Apply sandbox if enabled
pmName := g.packageManager.Name()
result, err := executor.ApplySandbox(ctx, cmd, pmName)
if err != nil {
return fmt.Errorf("failed to apply sandbox: %w", err)
}
defer result.Close() // Clean up sandbox resources
// Only run the command if the sandbox didn't already execute it
defer result.Close()
if result.ShouldRun() {
// We will fail based on executed command's exit code. This is important
// because other tools (scripts, CI etc.) may depend on this exit code.
return cmd.Run()
}