Skip to content

Commit

Permalink
Clear PHP and .phar cache on failed execution
Browse files Browse the repository at this point in the history
Lightly resolve issues where PHP binary does not work, especially on Windows
  • Loading branch information
akalipetis committed Dec 2, 2024
1 parent d7b863b commit 57115a8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/legacy/legacy.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,9 @@ func (c *CLIWrapper) Exec(ctx context.Context, args ...string) error {
c.Version,
))
if err := cmd.Run(); err != nil {
// Cleanup cache directory
c.debugLog("removing cache directory: %s", c.cacheDir())
os.RemoveAll(c.cacheDir())
return fmt.Errorf("could not run legacy CLI command: %w", err)
}

Expand Down

0 comments on commit 57115a8

Please sign in to comment.