Skip to content
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
5 changes: 0 additions & 5 deletions commands/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ func newVersionCommand(cnf *config.Config) *cobra.Command {
"Embedded PHP version %s\n",
color.CyanString(legacy.PHPVersion),
)
fmt.Fprintf(
color.Output,
"Embedded Legacy CLI version %s\n",
color.CyanString(legacy.LegacyCLIVersion),
)
fmt.Fprintf(
color.Output,
"Commit %s (built %s by %s)\n",
Expand Down
12 changes: 4 additions & 8 deletions internal/legacy/legacy.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@ import (
//go:embed archives/platform.phar
var phar []byte

var (
LegacyCLIVersion = "0.0.0"
PHPVersion = "0.0.0"
)
var PHPVersion = "0.0.0"

const configBasename = "config.yaml"

Expand Down Expand Up @@ -58,7 +55,7 @@ func (c *CLIWrapper) cacheDir() (string, error) {
if err != nil {
return "", err
}
cd = filepath.Join(cd, fmt.Sprintf("legacy-%s-%s", PHPVersion, LegacyCLIVersion))
cd = filepath.Join(cd, "legacy-"+c.Version)
if err := os.Mkdir(cd, 0o700); err != nil && !errors.Is(err, fs.ErrExist) {
return "", err
}
Expand Down Expand Up @@ -152,11 +149,10 @@ func (c *CLIWrapper) Exec(ctx context.Context, args ...string) error {
cmd.Env = append(cmd.Env, "CLICOLOR_FORCE=1")
}
cmd.Env = append(cmd.Env, fmt.Sprintf(
"%sUSER_AGENT={APP_NAME_DASH}/%s ({UNAME_S}; {UNAME_R}; PHP %s; WRAPPER %s)",
"%sUSER_AGENT={APP_NAME_DASH}/%s ({UNAME_S}; {UNAME_R}; PHP %s)",
envPrefix,
LegacyCLIVersion,
PHPVersion,
c.Version,
PHPVersion,
))
if err := cmd.Run(); err != nil {
return fmt.Errorf("could not run PHP CLI command: %w", err)
Expand Down
1 change: 0 additions & 1 deletion internal/legacy/legacy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ func TestLegacyCLI(t *testing.T) {
wrapper.DebugLogFunc = t.Logf
}
PHPVersion = "6.5.4"
LegacyCLIVersion = "3.2.1"

err := wrapper.Exec(context.Background(), "help")
assert.NoError(t, err)
Expand Down
Loading