mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
* Add app package and move logic over from api package * Change app package functions to return errors * Move non-api tests into app package * Fix merge
31 lines
877 B
Go
31 lines
877 B
Go
// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
|
|
// See License.txt for license information.
|
|
package main
|
|
|
|
import (
|
|
"github.com/mattermost/platform/app"
|
|
"github.com/mattermost/platform/model"
|
|
"github.com/mattermost/platform/store"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
var versionCmd = &cobra.Command{
|
|
Use: "version",
|
|
Short: "Display version information",
|
|
Run: versionCmdF,
|
|
}
|
|
|
|
func versionCmdF(cmd *cobra.Command, args []string) {
|
|
initDBCommandContextCobra(cmd)
|
|
printVersion()
|
|
}
|
|
|
|
func printVersion() {
|
|
CommandPrintln("Version: " + model.CurrentVersion)
|
|
CommandPrintln("Build Number: " + model.BuildNumber)
|
|
CommandPrintln("Build Date: " + model.BuildDate)
|
|
CommandPrintln("Build Hash: " + model.BuildHash)
|
|
CommandPrintln("Build Enterprise Ready: " + model.BuildEnterpriseReady)
|
|
CommandPrintln("DB Version: " + app.Srv.Store.(*store.SqlStore).SchemaVersion)
|
|
}
|