mirror of https://github.com/databricks/cli.git
review comments
This commit is contained in:
parent
d846c91f96
commit
2bcfa22a5b
|
@ -20,7 +20,7 @@ func newInstallCommand() *cobra.Command {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
return inst.Install(cmd.Context(), offlineInstall)
|
return inst.Install(cmd.Context())
|
||||||
}
|
}
|
||||||
return cmd
|
return cmd
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
type installable interface {
|
type installable interface {
|
||||||
Install(ctx context.Context, offlineInstall bool) error
|
Install(ctx context.Context) error
|
||||||
}
|
}
|
||||||
|
|
||||||
type devInstallation struct {
|
type devInstallation struct {
|
||||||
|
@ -23,7 +23,7 @@ type devInstallation struct {
|
||||||
*cobra.Command
|
*cobra.Command
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *devInstallation) Install(ctx context.Context, offlineInstall bool) error {
|
func (d *devInstallation) Install(ctx context.Context) error {
|
||||||
if d.Installer == nil {
|
if d.Installer == nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -87,9 +87,10 @@ func NewInstaller(cmd *cobra.Command, name string, offlineInstall bool) (install
|
||||||
}
|
}
|
||||||
|
|
||||||
return &installer{
|
return &installer{
|
||||||
Project: prj,
|
Project: prj,
|
||||||
version: version,
|
version: version,
|
||||||
cmd: cmd,
|
cmd: cmd,
|
||||||
|
offlineInstall: offlineInstall,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -76,10 +76,11 @@ type installer struct {
|
||||||
// command instance is used for:
|
// command instance is used for:
|
||||||
// - auth profile flag override
|
// - auth profile flag override
|
||||||
// - standard input, output, and error streams
|
// - standard input, output, and error streams
|
||||||
cmd *cobra.Command
|
cmd *cobra.Command
|
||||||
|
offlineInstall bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *installer) Install(ctx context.Context, offlineInstall bool) error {
|
func (i *installer) Install(ctx context.Context) error {
|
||||||
err := i.EnsureFoldersExist()
|
err := i.EnsureFoldersExist()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("folders: %w", err)
|
return fmt.Errorf("folders: %w", err)
|
||||||
|
@ -101,7 +102,7 @@ func (i *installer) Install(ctx context.Context, offlineInstall bool) error {
|
||||||
} else if err != nil {
|
} else if err != nil {
|
||||||
return fmt.Errorf("login: %w", err)
|
return fmt.Errorf("login: %w", err)
|
||||||
}
|
}
|
||||||
if !offlineInstall {
|
if !i.offlineInstall {
|
||||||
err = i.downloadLibrary(ctx)
|
err = i.downloadLibrary(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("lib: %w", err)
|
return fmt.Errorf("lib: %w", err)
|
||||||
|
|
Loading…
Reference in New Issue