Skip to content

Commit

Permalink
GitHub version checker refactored
Browse files Browse the repository at this point in the history
  • Loading branch information
vpoluyaktov committed Nov 13, 2023
1 parent 9edad03 commit ccaf65e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ var (
var (
configFile = "config.yaml"
appVersion, buildDate string
repoOwner string = "vpoluyaktov"
repoName string = "abb_ia"
)

// Fields of this stuct should to be private but I have to make them public because yaml.Marshal/Unmarshal can't work with private fields
Expand Down Expand Up @@ -314,6 +316,14 @@ func (c *Config) AppVersion() string {
return appVersion
}

func (c *Config) GetRepoOwner() string {
return repoOwner
}

func (c *Config) GetRepoName() string {
return repoName
}

func (c *Config) GetBuildDate() string {
// 2023-07-20T14:45:12Z
fmt := "01/02/2006"
Expand Down
2 changes: 1 addition & 1 deletion internal/controller/bootController.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func (c *BootController) checkFFmpeg() bool {

func (c *BootController) checkNewVersion() {

latestVersion, err := utils.GetLatestVersion("vpoluyaktov", "abb_ia")
latestVersion, err := utils.GetLatestVersion(config.Instance().GetRepoOwner(), config.Instance().GetRepoName())
if err != nil {
logger.Error("Can't check new version: " + err.Error())
return
Expand Down

0 comments on commit ccaf65e

Please sign in to comment.