diff --git a/cli/install.go b/cli/install.go index b4b2ef7..58c2836 100644 --- a/cli/install.go +++ b/cli/install.go @@ -10,6 +10,7 @@ import ( "strings" "github.com/livingsilver94/backee/installer" + "github.com/livingsilver94/backee/installer/stepwriter" "github.com/livingsilver94/backee/repo" "github.com/livingsilver94/backee/repo/solver" "github.com/livingsilver94/backee/service" @@ -110,7 +111,7 @@ func (in *install) installer(rep repo.FS, fileList **os.File) installer.Installe installer.WithVarSolvers(map[service.VarKind]repo.VarSolver{"keepassxc": kee}), ) } - return installer.New(rep, opts...) + return installer.New(rep, stepwriter.OS{}, opts...) } // envVars returns a map of environment variables. diff --git a/cli/privilege.go b/cli/privilege.go index f380b42..a061b5b 100644 --- a/cli/privilege.go +++ b/cli/privilege.go @@ -6,7 +6,7 @@ package cli import ( "os" - _ "github.com/livingsilver94/backee/installer" + _ "github.com/livingsilver94/backee/installer/stepwriter" priv "github.com/livingsilver94/backee/privilege" ) diff --git a/installer/installer.go b/installer/installer.go index 8c892a5..08a30bd 100644 --- a/installer/installer.go +++ b/installer/installer.go @@ -13,17 +13,18 @@ import ( type Installer struct { repository repo.Repo - variables repo.Variables - list List writer StepWriter + + variables repo.Variables + list List } -func New(repository repo.Repo, options ...Option) Installer { +func New(repository repo.Repo, sw StepWriter, options ...Option) Installer { i := Installer{ repository: repository, + writer: sw, variables: repo.NewVariables(), list: NewList(), - writer: nil, // TODO: pass a real writer. } i.variables.RegisterSolver(service.Datadir, solver.NewDatadir(repository)) for _, option := range options {