Skip to content

Commit

Permalink
Fix probable rebase issue
Browse files Browse the repository at this point in the history
  • Loading branch information
pjcdawkins committed Dec 10, 2024
1 parent c59c442 commit e16a11a
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions internal/legacy/legacy.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"github.com/gofrs/flock"

"github.com/platformsh/cli/internal/config"
"github.com/platformsh/cli/internal/file"
)

//go:embed archives/platform.phar
Expand Down Expand Up @@ -102,15 +103,8 @@ func (c *CLIWrapper) Init() error {
//nolint:errcheck
defer fileLock.Unlock()

if _, err := os.Stat(c.PharPath()); os.IsNotExist(err) {
if c.CustomPharPath != "" {
return fmt.Errorf("legacy CLI phar file not found: %w", err)
}

c.debugLog("phar file does not exist, copying: %s", c.PharPath())
if err := copyFile(c.PharPath(), phar); err != nil {
return fmt.Errorf("could not copy phar file: %w", err)
}
if err := file.CopyIfChanged(c.PharPath(), phar, phpCLIHash); err != nil {
return fmt.Errorf("could not copy phar file: %w", err)
}

// Always write the config.yaml file if it changed.
Expand Down

0 comments on commit e16a11a

Please sign in to comment.