Skip to content

Commit

Permalink
Merge pull request #220 from platformsh/hotfix/replace-tampered-files
Browse files Browse the repository at this point in the history
Clear PHP and .phar cache on failed execution
  • Loading branch information
akalipetis authored Dec 3, 2024
2 parents d7b863b + 57115a8 commit 1a1e573
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 1a1e573

Please sign in to comment.