mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 04:14:39 +03:00
Add -v/--version flag to print version string (#3883)
* Add `-v/--version` flag to print version string - Created a new flag `-v/--version` in the command-line interface to display the version number and exit. - Moved all version-related functions inside the config package to the new file `manager/config/version.go` to avoid circular dependencies. - Added a new `GetVersionString()` function to generate a formatted version string. - Updated references to the moved version functions. - Updated references in the `Makefile`. * Move version embeds to build package * Remove githash var --------- Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"sort"
|
||||
"strconv"
|
||||
|
||||
"github.com/stashapp/stash/internal/build"
|
||||
"github.com/stashapp/stash/internal/manager"
|
||||
"github.com/stashapp/stash/pkg/logger"
|
||||
"github.com/stashapp/stash/pkg/models"
|
||||
@@ -188,7 +189,7 @@ func (r *queryResolver) Stats(ctx context.Context) (*StatsResultType, error) {
|
||||
}
|
||||
|
||||
func (r *queryResolver) Version(ctx context.Context) (*Version, error) {
|
||||
version, hash, buildtime := GetVersion()
|
||||
version, hash, buildtime := build.Version()
|
||||
|
||||
return &Version{
|
||||
Version: &version,
|
||||
|
||||
Reference in New Issue
Block a user