@@ -89,9 +89,8 @@ func activateCmd(ctx context.Context, cmd *cli.Command) error {
8989 // Process SDKs concurrently using errgroup
9090 g , _ := errgroup .WithContext (ctx )
9191
92- for sdkName , version := range allTools {
92+ for sdkName := range allTools {
9393 sdkName := sdkName // Capture loop variable
94- version := version // Capture loop variable
9594
9695 g .Go (func () error {
9796 // Lookup SDK
@@ -101,10 +100,8 @@ func activateCmd(ctx context.Context, cmd *cli.Command) error {
101100 return nil // Continue processing other SDKs
102101 }
103102
104- sdkVersion := sdk .Version (version )
105-
106- // Get tool config with scope information (searches by priority)
107- toolConfig , scope , ok := chain .GetToolConfig (sdkName )
103+ // Resolve to the highest-priority installed version across scopes
104+ toolConfig , scope , sdkVersion , ok := resolveInstalledToolConfig (chain , sdkObj , sdkName )
108105 if ! ok {
109106 return nil
110107 }
@@ -121,14 +118,14 @@ func activateCmd(ctx context.Context, cmd *cli.Command) error {
121118 // Create symlinks if needed (internal logic checks if symlink already exists)
122119 if err := sdkObj .CreateSymlinksForScope (sdkVersion , actualScope ); err != nil {
123120 logger .Debugf ("Failed to create symlinks for %s@%s (scope: %s): %v" ,
124- sdkName , version , actualScope .String (), err )
121+ sdkName , sdkVersion , actualScope .String (), err )
125122 return nil // Continue processing other SDKs
126123 }
127124
128125 // Get environment variables pointing to symlinks
129126 sdkEnvs , err := sdkObj .EnvKeysForScope (sdkVersion , actualScope )
130127 if err != nil {
131- logger .Debugf ("Failed to get env keys for %s@%s: %v" , sdkName , version , err )
128+ logger .Debugf ("Failed to get env keys for %s@%s: %v" , sdkName , sdkVersion , err )
132129 return nil // Continue processing other SDKs
133130 }
134131
0 commit comments