]> git.maquefel.me Git - brevno-suite/hugo/commitdiff
Make the hugo env non verbose output slightly more verbose
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Tue, 6 Dec 2022 11:33:25 +0000 (12:33 +0100)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Tue, 6 Dec 2022 12:37:08 +0000 (13:37 +0100)
This is how it may look like with a extended build:

```
hugo v0.107.0-6445b1e9ff963b07c55d9d69cb9abef8ef21fc5d+extended darwin/arm64 BuildDate=2022-12-06T11:21:50Z
GOOS="darwin"
GOARCH="arm64"
GOVERSION="go1.19.3"
github.com/sass/libsass="3.6.5"
github.com/webmproject/libwebp="v1.2.4"
github.com/sass/dart-sass-embedded/protocol="1.1.0"
github.com/sass/dart-sass-embedded/compiler="1.56.1"
github.com/sass/dart-sass-embedded/implementation="1.56.1"
```

commands/env.go
common/hugo/hugo.go

index 65808b1be67ffd536396b7813168500ae6fca914..0fc509d6d422a4ce7a16eb007809632145e6a783 100644 (file)
@@ -50,6 +50,14 @@ If you add the -v flag, you will get a full dependency list.
                                        for _, dep := range deps {
                                                jww.FEEDBACK.Printf("%s\n", dep)
                                        }
+                               } else {
+                                       // These are also included in the GetDependencyList above;
+                                       // always print these as these are most likely the most useful to know about.
+                                       deps := hugo.GetDependencyListNonGo()
+                                       for _, dep := range deps {
+                                               jww.FEEDBACK.Printf("%s\n", dep)
+                                       }
+
                                }
 
                                return nil
index f463e261de3069fc718069ca50ff922e43ca0bcb..86a81a5d8e47e15395e81282d74be2fcc9b4e7e9 100644 (file)
@@ -186,19 +186,38 @@ func getBuildInfo() *buildInfo {
        return bInfo
 }
 
+func formatDep(path, version string) string {
+       return fmt.Sprintf("%s=%q", path, version)
+}
+
 // GetDependencyList returns a sorted dependency list on the format package="version".
 // It includes both Go dependencies and (a manually maintained) list of C(++) dependencies.
 func GetDependencyList() []string {
        var deps []string
 
-       formatDep := func(path, version string) string {
-               return fmt.Sprintf("%s=%q", path, version)
+       bi := getBuildInfo()
+       if bi == nil {
+               return deps
        }
 
+       for _, dep := range bi.Deps {
+               deps = append(deps, formatDep(dep.Path, dep.Version))
+       }
+
+       deps = append(deps, GetDependencyListNonGo()...)
+
+       sort.Strings(deps)
+
+       return deps
+}
+
+// GetDependencyListNonGo returns a list of non-Go dependencies.
+func GetDependencyListNonGo() []string {
+       var deps []string
+
        if IsExtended {
                deps = append(
                        deps,
-                       // TODO(bep) consider adding a DepsNonGo() method to these upstream projects.
                        formatDep("github.com/sass/libsass", "3.6.5"),
                        formatDep("github.com/webmproject/libwebp", "v1.2.4"),
                )
@@ -211,20 +230,7 @@ func GetDependencyList() []string {
                        formatDep(dartSassPath+"/compiler", dartSass.CompilerVersion),
                        formatDep(dartSassPath+"/implementation", dartSass.ImplementationVersion),
                )
-
-       }
-
-       bi := getBuildInfo()
-       if bi == nil {
-               return deps
        }
-
-       for _, dep := range bi.Deps {
-               deps = append(deps, formatDep(dep.Path, dep.Version))
-       }
-
-       sort.Strings(deps)
-
        return deps
 }