diff --git a/envbuilder.go b/envbuilder.go index e6f9c8d4..bcefd022 100644 --- a/envbuilder.go +++ b/envbuilder.go @@ -47,6 +47,7 @@ import ( "github.com/google/go-containerregistry/pkg/v1/remote" "github.com/kballard/go-shellquote" "github.com/mattn/go-isatty" + "github.com/mitchellh/go-wordwrap" "github.com/sirupsen/logrus" "github.com/tailscale/hujson" "golang.org/x/xerrors" @@ -104,7 +105,10 @@ func Run(ctx context.Context, opts options.Options, preExec ...func()) error { return fmt.Errorf("set uid: %w", err) } - opts.Logger(log.LevelInfo, "=== Running init command as user %q: %q", args.UserInfo.user.Username, append([]string{opts.InitCommand}, args.InitArgs...)) + initCmd := strings.Join(append([]string{opts.InitCommand}, args.InitArgs...), " ") + opts.Logger(log.LevelInfo, "=== Running init command as user %q:", args.UserInfo.user.Username) + opts.Logger(log.LevelInfo, wordwrap.WrapString(initCmd, 80)) + opts.Logger(log.LevelInfo, "===") for _, fn := range preExec { fn() }