Implement EnvironmentManager for safe environment variable and PATH management#55
Merged
Implement EnvironmentManager for safe environment variable and PATH management#55
Conversation
d7b94e6 to
8f02697
Compare
…anagement - Create EnvironmentManager class with safe environment variable management - Add special PATH handling with AddToPath() and AppendToPath() methods - Update EnvironmentProvider interface to use EnvironmentManager instead of map - Update all tools (Go, Java, Maven, Mvnd, Node) to use new EnvironmentProvider interface - Implement comprehensive Go environment setup with GOROOT, GOPATH, and PATH management - Add EnvGoPath constant for GOPATH environment variable - Fix executor environment setup to properly merge tool-specific PATH modifications - Resolve golangci-lint PATH issues by ensuring GOPATH/bin is included in PATH - Use 'env golangci-lint run' workaround for mvx-shell interpreter limitations - Make Manager.SetupEnvironment() the single source of truth for all environment setup - Remove duplicated PATH logic from cmd/env.go and cmd/root.go - Simplify executor to use complete environment from Manager - Manager now starts with system environment and adds tool-specific modifications - Each tool contributes both HOME directories and PATH entries via SetupEnvironment() - Eliminates scattered environment logic across multiple files - Follows Single Responsibility Principle with centralized environment management This establishes a robust foundation for environment management across all tools and resolves the core issue where tool-specific PATH modifications were being lost during command execution. It also resolves the architectural issue where environment setup was scattered across multiple files with inconsistent behavior between shell integration, global setup, and command execution.
8f02697 to
c373a5a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This establishes a robust foundation for environment management across all tools
and resolves the core issue where tool-specific PATH modifications were being
lost during command execution. It also resolves the architectural issue where environment
setup was scattered across multiple files with inconsistent behavior between shell
integration, global setup, and command execution.