Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2020-01-30 11:08:49 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2020-01-30 19:15:35 +0300
commit49ef6472039ede7d485242eba511207a8274495a (patch)
treeaa7c974699598c6aa649237028ccf2529e15fa9e /commands
parent8f08cdd0ac6a2decd5aa5c9c12c0b2c264f9a989 (diff)
modules: Fix "hugo mod get -u" with no arguments
Fixes #6826 Closes #6825
Diffstat (limited to 'commands')
-rw-r--r--commands/commandeer.go12
-rw-r--r--commands/mod.go1
2 files changed, 3 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
}
diff --git a/commands/mod.go b/commands/mod.go
index 5fbd93ecb..0b3e193b9 100644
--- a/commands/mod.go
+++ b/commands/mod.go
@@ -77,6 +77,7 @@ Run "go help get" for more information. All flags available for "go get" is also
` + commonUsage,
RunE: func(cmd *cobra.Command, args []string) error {
return c.withModsClient(false, func(c *modules.Client) error {
+
// We currently just pass on the flags we get to Go and
// need to do the flag handling manually.
if len(args) == 1 && args[0] == "-h" {