pkg/environment: Remove exec related functions

This commit starts the migration to remove the environment package. It
introduced an abstraction that is not being used, and removing it makes
the code simpler to maintain.

This commit removes all 'exec' related package.
This commit is contained in:
Tom Wiesing 2023-03-02 11:03:33 +01:00
parent 066390e30d
commit 14bb7f1086
No known key found for this signature in database
6 changed files with 32 additions and 25 deletions

View file

@ -9,6 +9,7 @@ import (
"github.com/FAU-CDI/wisski-distillery/internal/cli"
"github.com/FAU-CDI/wisski-distillery/internal/dis/component"
"github.com/FAU-CDI/wisski-distillery/pkg/environment"
"github.com/FAU-CDI/wisski-distillery/pkg/execx"
"github.com/FAU-CDI/wisski-distillery/pkg/fsx"
"github.com/FAU-CDI/wisski-distillery/pkg/logging"
"github.com/tkw1536/goprogram/exit"
@ -195,7 +196,7 @@ func (si systemupdate) mustExec(context wisski_distillery.Context, workdir strin
if workdir == "" {
workdir = dis.Config.Paths.Root
}
code := dis.Still.Environment.Exec(context.Context, context.IOStream, workdir, exe, argv...)()
code := execx.Exec(context.Context, context.IOStream, workdir, exe, argv...)()
if code != 0 {
err := errMustExecFailed.WithMessageF(code)
err.ExitCode = exit.ExitCode(code)