diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2020-01-30 09:08:49 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2020-01-30 17:15:35 +0100 |
commit | 49ef6472039ede7d485242eba511207a8274495a (patch) | |
tree | aa7c974699598c6aa649237028ccf2529e15fa9e /commands/commandeer.go | |
parent | 8f08cdd0ac6a2decd5aa5c9c12c0b2c264f9a989 (diff) |
modules: Fix "hugo mod get -u" with no arguments
Fixes #6826
Closes #6825
Diffstat (limited to 'commands/commandeer.go')
-rw-r--r-- | commands/commandeer.go | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/commands/commandeer.go b/commands/commandeer.go index 761d79912..8c8440a7a 100644 --- a/commands/commandeer.go +++ b/commands/commandeer.go @@ -20,8 +20,6 @@ import ( "golang.org/x/sync/semaphore" - "github.com/gohugoio/hugo/modules" - "io/ioutil" "github.com/gohugoio/hugo/common/herrors" @@ -312,14 +310,8 @@ func (c *commandeer) loadConfig(mustHaveConfigFile, running bool) error { doWithCommandeer, doWithConfig) - if err != nil { - if mustHaveConfigFile { - return err - } - if err != hugolib.ErrNoConfigFile && !modules.IsNotExist(err) { - return err - } - + if err != nil && mustHaveConfigFile { + return err } else if mustHaveConfigFile && len(configFiles) == 0 { return hugolib.ErrNoConfigFile } |