Skip to content

Commit

Permalink
refactor: move version to separate file
Browse files Browse the repository at this point in the history
  • Loading branch information
akshettrj committed Dec 7, 2024
1 parent 16146ec commit 1b949f3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion nix/pkgs/watgbridge-dev.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ let
in
buildGoApplication rec {
pname = "watgbridge";
version = "1.11.0";
version = (lib.trim (builtins.readFile ../../state/version.txt));

pwd = localSrc;
src = localSrc;
Expand Down
6 changes: 5 additions & 1 deletion state/state.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package state

import (
_ "embed"
"strings"
"time"

"github.com/PaulSonOfLars/gotgbot/v2"
Expand All @@ -10,7 +12,8 @@ import (
"gorm.io/gorm"
)

const WATGBRIDGE_VERSION = "1.11.0"
//go:embed version.txt
var WATGBRIDGE_VERSION string

type state struct {
Config *Config
Expand All @@ -33,5 +36,6 @@ type state struct {
var State state

func init() {
WATGBRIDGE_VERSION = strings.TrimSpace(WATGBRIDGE_VERSION)
State.Config = &Config{Path: "config.yaml"}
}
1 change: 1 addition & 0 deletions state/version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.11.0

0 comments on commit 1b949f3

Please sign in to comment.