@@ -14,10 +14,10 @@ import (
1414)
1515
1616// InstallTools installs all tools defined in the configuration
17- func InstallTools () error {
18- for name , toolInfo := range Config .Tools () {
17+ func InstallTools (config * ConfigType , registry string ) error {
18+ for name , toolInfo := range config .Tools () {
1919 fmt .Printf ("Installing tool: %s v%s...\n " , name , toolInfo .Version )
20- err := InstallTool (name , toolInfo )
20+ err := InstallTool (name , toolInfo , registry )
2121 if err != nil {
2222 return fmt .Errorf ("failed to install tool %s: %w" , name , err )
2323 }
@@ -27,7 +27,7 @@ func InstallTools() error {
2727}
2828
2929// InstallTool installs a specific tool
30- func InstallTool (name string , toolInfo * plugins.ToolInfo ) error {
30+ func InstallTool (name string , toolInfo * plugins.ToolInfo , registry string ) error {
3131 fmt .Println ("Installing tool" , name , "in" , toolInfo .InstallDir )
3232 // Check if the tool is already installed
3333 if isToolInstalled (toolInfo ) {
@@ -57,10 +57,10 @@ func InstallTool(name string, toolInfo *plugins.ToolInfo) error {
5757
5858 // For runtime-based tools
5959 fmt .Printf ("Installing %s using %s runtime...\n " , name , toolInfo .Runtime )
60- return installRuntimeTool (name , toolInfo )
60+ return installRuntimeTool (name , toolInfo , registry )
6161}
6262
63- func installRuntimeTool (name string , toolInfo * plugins.ToolInfo ) error {
63+ func installRuntimeTool (name string , toolInfo * plugins.ToolInfo , registry string ) error {
6464 // Get the runtime for this tool
6565 runtimeInfo , ok := Config .Runtimes ()[toolInfo .Runtime ]
6666 if ! ok {
@@ -72,7 +72,7 @@ func installRuntimeTool(name string, toolInfo *plugins.ToolInfo) error {
7272 "InstallDir" : toolInfo .InstallDir ,
7373 "PackageName" : toolInfo .Name ,
7474 "Version" : toolInfo .Version ,
75- "Registry" : "" , // TODO: Get registry from config
75+ "Registry" : registry ,
7676 }
7777
7878 // Get package manager binary based on the tool configuration
@@ -83,12 +83,14 @@ func installRuntimeTool(name string, toolInfo *plugins.ToolInfo) error {
8383 }
8484
8585 // Set registry if provided
86- if toolInfo . RegistryCommand != "" {
86+ if registry != "" {
8787 regCmd , err := executeToolTemplate (toolInfo .RegistryCommand , templateData )
8888 if err != nil {
8989 return fmt .Errorf ("failed to prepare registry command: %w" , err )
9090 }
9191
92+ log .Printf ("Setting registry...\n %s %s\n " , packageManagerBinary , regCmd )
93+
9294 if regCmd != "" {
9395 registryCmd := exec .Command (packageManagerBinary , strings .Split (regCmd , " " )... )
9496 if output , err := registryCmd .CombinedOutput (); err != nil {
0 commit comments