wdcli: Use progress writer instead of IOStream
This commit is contained in:
parent
890022ae64
commit
3b78b06fff
49 changed files with 396 additions and 393 deletions
|
|
@ -3,10 +3,11 @@ package instances
|
|||
import (
|
||||
"context"
|
||||
"embed"
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/FAU-CDI/wisski-distillery/pkg/unpack"
|
||||
"github.com/tkw1536/goprogram/exit"
|
||||
"github.com/tkw1536/goprogram/stream"
|
||||
)
|
||||
|
||||
var errBootstrapFailedRuntime = exit.Error{
|
||||
|
|
@ -20,9 +21,9 @@ var errBootstrapFailedRuntime = exit.Error{
|
|||
var runtimeResources embed.FS
|
||||
|
||||
// Update installs or updates runtime components needed by this component.
|
||||
func (instances *Instances) Update(ctx context.Context, stream stream.IOStream) error {
|
||||
func (instances *Instances) Update(ctx context.Context, progress io.Writer) error {
|
||||
err := unpack.InstallDir(instances.Still.Environment, instances.Config.RuntimeDir(), "runtime", runtimeResources, func(dst, src string) {
|
||||
stream.Printf("[copy] %s\n", dst)
|
||||
fmt.Fprintf(progress, "[copy] %s\n", dst)
|
||||
})
|
||||
if err != nil {
|
||||
return errBootstrapFailedRuntime.Wrap(err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue