add constants package for constants
This commit is contained in:
parent
ec937603fd
commit
55ec4af875
|
@ -3,16 +3,13 @@ package command
|
||||||
import (
|
import (
|
||||||
"github.com/Pterodactyl/wings/api"
|
"github.com/Pterodactyl/wings/api"
|
||||||
"github.com/Pterodactyl/wings/config"
|
"github.com/Pterodactyl/wings/config"
|
||||||
|
"github.com/Pterodactyl/wings/constants"
|
||||||
"github.com/Pterodactyl/wings/tools"
|
"github.com/Pterodactyl/wings/tools"
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
// RootCommand is the root command of wings
|
||||||
// Version of pterodactyld
|
|
||||||
Version = "0.0.1-alpha"
|
|
||||||
)
|
|
||||||
|
|
||||||
var RootCommand = &cobra.Command{
|
var RootCommand = &cobra.Command{
|
||||||
Use: "wings",
|
Use: "wings",
|
||||||
Short: "",
|
Short: "",
|
||||||
|
@ -24,6 +21,7 @@ func init() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Execute registers the RootCommand
|
||||||
func Execute() {
|
func Execute() {
|
||||||
RootCommand.Execute()
|
RootCommand.Execute()
|
||||||
}
|
}
|
||||||
|
@ -31,7 +29,7 @@ func Execute() {
|
||||||
func run(cmd *cobra.Command, args []string) {
|
func run(cmd *cobra.Command, args []string) {
|
||||||
tools.InitLogging()
|
tools.InitLogging()
|
||||||
log.Info("Loading configuration")
|
log.Info("Loading configuration")
|
||||||
if err := config.LoadConfiguration(nil); err != nil {
|
if err := config.LoadConfiguration(""); err != nil {
|
||||||
log.WithError(err).Fatal("Failed to find configuration file")
|
log.WithError(err).Fatal("Failed to find configuration file")
|
||||||
}
|
}
|
||||||
tools.ConfigureLogging()
|
tools.ConfigureLogging()
|
||||||
|
@ -41,7 +39,7 @@ func run(cmd *cobra.Command, args []string) {
|
||||||
log.Info(`\_____\ \/\/ / / / __ / ___/`)
|
log.Info(`\_____\ \/\/ / / / __ / ___/`)
|
||||||
log.Info(` \___\ / / / / /_/ /___ /`)
|
log.Info(` \___\ / / / / /_/ /___ /`)
|
||||||
log.Info(` \___/\___/___/___/___/___ /______/`)
|
log.Info(` \___/\___/___/___/___/___ /______/`)
|
||||||
log.Info(` /_______/ v` + Version)
|
log.Info(` /_______/ v` + constants.Version)
|
||||||
log.Info()
|
log.Info()
|
||||||
|
|
||||||
log.Info("Configuration loaded successfully.")
|
log.Info("Configuration loaded successfully.")
|
||||||
|
|
4
constants/constants.go
Normal file
4
constants/constants.go
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
package constants
|
||||||
|
|
||||||
|
// Version is the current wings version
|
||||||
|
const Version = "0.0.1-alpha"
|
Loading…
Reference in New Issue
Block a user