refactor: dedicated constants package, no explicit bridge version

This commit is contained in:
James Houlahan
2020-04-23 10:07:41 +02:00
committed by Jakub Cuth
parent 32ca7b3903
commit 522cadb8b1
11 changed files with 88 additions and 42 deletions

View File

@ -23,6 +23,7 @@ import (
"os"
"path/filepath"
"github.com/ProtonMail/gopenpgp/constants"
"github.com/ProtonMail/proton-bridge/pkg/pmapi"
)
@ -48,13 +49,16 @@ func (c *fakeConfig) ClearData() error {
}
func (c *fakeConfig) GetAPIConfig() *pmapi.ClientConfig {
return &pmapi.ClientConfig{
AppVersion: "Bridge_" + os.Getenv("VERSION"),
AppVersion: "Bridge_" + constants.Version,
ClientID: "bridge",
}
}
func (c *fakeConfig) GetDBDir() string {
return c.dir
}
func (c *fakeConfig) GetVersion() string {
return constants.Version
}
func (c *fakeConfig) GetLogDir() string {
return c.dir
}