github.com/turbot/steampipe@v1.7.0-rc.0.0.20240517123944-7cef272d4458/pkg/modinstaller/install.go (about)

     1  package modinstaller
     2  
     3  import (
     4  	"context"
     5  
     6  	"github.com/turbot/go-kit/helpers"
     7  	"github.com/turbot/steampipe/pkg/error_helpers"
     8  	"github.com/turbot/steampipe/pkg/utils"
     9  )
    10  
    11  func InstallWorkspaceDependencies(ctx context.Context, opts *InstallOpts) (_ *InstallData, err error) {
    12  	utils.LogTime("cmd.InstallWorkspaceDependencies")
    13  	defer func() {
    14  		utils.LogTime("cmd.InstallWorkspaceDependencies end")
    15  		if r := recover(); r != nil {
    16  			error_helpers.ShowError(ctx, helpers.ToError(r))
    17  		}
    18  	}()
    19  
    20  	// install workspace dependencies
    21  	installer, err := NewModInstaller(ctx, opts)
    22  	if err != nil {
    23  		return nil, err
    24  	}
    25  
    26  	if err := installer.InstallWorkspaceDependencies(ctx); err != nil {
    27  		return nil, err
    28  	}
    29  
    30  	return installer.installData, nil
    31  }