mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
* move sql store code into store/sqlstore package * move non-sql constants back up to store * fix api test * derp
40 lines
1.1 KiB
Go
40 lines
1.1 KiB
Go
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
|
|
// See License.txt for license information.
|
|
package main
|
|
|
|
import (
|
|
"github.com/mattermost/mattermost-server/app"
|
|
"github.com/mattermost/mattermost-server/model"
|
|
"github.com/mattermost/mattermost-server/store"
|
|
"github.com/mattermost/mattermost-server/store/sqlstore"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
var versionCmd = &cobra.Command{
|
|
Use: "version",
|
|
Short: "Display version information",
|
|
RunE: versionCmdF,
|
|
}
|
|
|
|
func versionCmdF(cmd *cobra.Command, args []string) error {
|
|
a, err := initDBCommandContextCobra(cmd)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
printVersion(a)
|
|
|
|
return nil
|
|
}
|
|
|
|
func printVersion(a *app.App) {
|
|
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)
|
|
if supplier, ok := a.Srv.Store.(*store.LayeredStore).DatabaseLayer.(*sqlstore.SqlSupplier); ok {
|
|
CommandPrintln("DB Version: " + supplier.GetCurrentSchemaVersion())
|
|
}
|
|
}
|