@@ -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 // Check if the tool is already installed
3232 if isToolInstalled (toolInfo ) {
3333 fmt .Printf ("Tool %s v%s is already installed\n " , name , toolInfo .Version )
@@ -55,10 +55,10 @@ func InstallTool(name string, toolInfo *plugins.ToolInfo) error {
5555
5656 // For runtime-based tools
5757 fmt .Printf ("Installing %s using %s runtime...\n " , name , toolInfo .Runtime )
58- return installRuntimeTool (name , toolInfo )
58+ return installRuntimeTool (name , toolInfo , registry )
5959}
6060
61- func installRuntimeTool (name string , toolInfo * plugins.ToolInfo ) error {
61+ func installRuntimeTool (name string , toolInfo * plugins.ToolInfo , registry string ) error {
6262 // Get the runtime for this tool
6363 runtimeInfo , ok := Config .Runtimes ()[toolInfo .Runtime ]
6464 if ! ok {
@@ -70,7 +70,7 @@ func installRuntimeTool(name string, toolInfo *plugins.ToolInfo) error {
7070 "InstallDir" : toolInfo .InstallDir ,
7171 "PackageName" : toolInfo .Name ,
7272 "Version" : toolInfo .Version ,
73- "Registry" : "" , // TODO: Get registry from config
73+ "Registry" : registry ,
7474 }
7575
7676 // Get package manager binary based on the tool configuration
@@ -81,12 +81,14 @@ func installRuntimeTool(name string, toolInfo *plugins.ToolInfo) error {
8181 }
8282
8383 // Set registry if provided
84- if toolInfo . RegistryCommand != "" {
84+ if registry != "" {
8585 regCmd , err := executeToolTemplate (toolInfo .RegistryCommand , templateData )
8686 if err != nil {
8787 return fmt .Errorf ("failed to prepare registry command: %w" , err )
8888 }
8989
90+ log .Printf ("Setting registry...\n %s %s\n " , packageManagerBinary , regCmd )
91+
9092 if regCmd != "" {
9193 registryCmd := exec .Command (packageManagerBinary , strings .Split (regCmd , " " )... )
9294 if output , err := registryCmd .CombinedOutput (); err != nil {
0 commit comments