2018-12-21 04:32:17 +01:00
|
|
|
package commands
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
2019-05-06 23:18:10 +02:00
|
|
|
"github.com/photoprism/photoprism/internal/config"
|
2018-12-21 04:32:17 +01:00
|
|
|
"github.com/urfave/cli"
|
|
|
|
)
|
|
|
|
|
2021-01-24 17:46:18 +01:00
|
|
|
// VersionCommand registers the version cli command.
|
2018-12-21 04:32:17 +01:00
|
|
|
var VersionCommand = cli.Command{
|
|
|
|
Name: "version",
|
2018-12-21 04:40:45 +01:00
|
|
|
Usage: "Shows version information",
|
2018-12-21 04:32:17 +01:00
|
|
|
Action: versionAction,
|
|
|
|
}
|
|
|
|
|
2020-02-18 23:42:51 +01:00
|
|
|
// versionAction prints the current version
|
2018-12-21 04:32:17 +01:00
|
|
|
func versionAction(ctx *cli.Context) error {
|
2019-05-06 23:18:10 +02:00
|
|
|
conf := config.NewConfig(ctx)
|
2018-12-21 04:32:17 +01:00
|
|
|
|
2019-05-06 23:18:10 +02:00
|
|
|
fmt.Println(conf.Version())
|
2018-12-21 04:32:17 +01:00
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|