Inlcude build in vars in version output

This commit is contained in:
Christian Goll
2022-04-26 11:13:54 +02:00
parent c29848171e
commit 673253fbe0

View File

@@ -3,13 +3,25 @@ package version
import ( import (
"fmt" "fmt"
"github.com/hpcng/warewulf/internal/pkg/buildconfig"
"github.com/hpcng/warewulf/internal/pkg/version" "github.com/hpcng/warewulf/internal/pkg/version"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
func CobraRunE(cmd *cobra.Command, args []string) error { func CobraRunE(cmd *cobra.Command, args []string) error {
fmt.Println("Version:\t", version.GetVersion()) fmt.Println("VERSION:\t", version.GetVersion())
fmt.Println("BINDIR:\t", buildconfig.BINDIR())
fmt.Println("DATADIR:\t", buildconfig.DATADIR())
fmt.Println("SYSCONFDIR:\t", buildconfig.SYSCONFDIR())
fmt.Println("LOCALSTATEDIR:\t", buildconfig.LOCALSTATEDIR())
fmt.Println("SRVDIR:\t", buildconfig.SRVDIR())
fmt.Println("TFTPDIR:\t", buildconfig.TFTPDIR())
fmt.Println("SYSTEMDDIR:\t", buildconfig.SYSTEMDDIR())
fmt.Println("WWOVERLAYDIR:\t", buildconfig.WWOVERLAYDIR())
fmt.Println("WWCHROOTDIR:\t", buildconfig.WWCHROOTDIR())
fmt.Println("WWPROVISIONDIR:\t", buildconfig.WWPROVISIONDIR())
fmt.Println("WWCLIENTDIR:\t", buildconfig.WWCLIENTDIR())
return nil return nil
} }