diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2019-11-21 13:07:52 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2019-11-21 18:11:07 +0100 |
commit | 2dcc1318d1d9ed849d040115aa5ba6191a1c102a (patch) | |
tree | 913e5537df47c555a1d00e44d97609341edb36c3 /modules/client.go | |
parent | 14a985f8abc527d4e8487fcd5fa742e1ab2a00ed (diff) |
Add some more output if loading modules takes time
Also include the time to collect modules etc. in the "Total in ..." time reported for the `hugo` command.
Fixes #6519
Diffstat (limited to 'modules/client.go')
-rw-r--r-- | modules/client.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/modules/client.go b/modules/client.go index a743df5bd..462cd6017 100644 --- a/modules/client.go +++ b/modules/client.go @@ -259,7 +259,7 @@ func (c *Client) Vendor() error { // Get runs "go get" with the supplied arguments. func (c *Client) Get(args ...string) error { - if err := c.runGo(context.Background(), os.Stdout, append([]string{"get"}, args...)...); err != nil { + if err := c.runGo(context.Background(), c.logger.Out, append([]string{"get"}, args...)...); err != nil { errors.Wrapf(err, "failed to get %q", args) } return nil @@ -269,7 +269,7 @@ func (c *Client) Get(args ...string) error { // If path is empty, Go will try to guess. // If this succeeds, this project will be marked as Go Module. func (c *Client) Init(path string) error { - err := c.runGo(context.Background(), os.Stdout, "mod", "init", path) + err := c.runGo(context.Background(), c.logger.Out, "mod", "init", path) if err != nil { return errors.Wrap(err, "failed to init modules") } @@ -410,6 +410,8 @@ func (c *Client) runGo( return nil } + //defer c.logger.PrintTimer(time.Now(), fmt.Sprint(args)) + stderr := new(bytes.Buffer) cmd := exec.CommandContext(ctx, "go", args...) |