Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
evlekht committed Dec 3, 2024
1 parent e2831e9 commit a7e3068
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 15 deletions.
5 changes: 3 additions & 2 deletions cmd/camino_messenger_bot.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
var rootCmd = &cobra.Command{
Use: "camino-messenger-bot",
Short: "starts camino messenger bot",
Version: constants.BotVersion,
Version: constants.AppVersion,
SuggestFor: []string{"camino-messenger", "camino-messenger-bot", "camino-bot", "cmb"},
RunE: rootFunc,
}
Expand Down Expand Up @@ -58,7 +58,8 @@ func rootFunc(cmd *cobra.Command, _ []string) error {
logger := zapLogger.Sugar()
defer func() { _ = logger.Sync() }()

logger.Infof("App version: %s (git: %s)", constants.BotVersion, constants.BotGitCommit) // TODO@
logger.Infof("App version: %s (git: %s)", constants.AppVersion, constants.AppGitCommit)
logger.Infof("Protocol version: %s", constants.ProtocolVersion)

app, err := app.NewApp(ctx, cfg, logger)
if err != nil {
Expand Down
18 changes: 7 additions & 11 deletions internal/constants/constants.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
package constants

const (
ProtocolVersion = "v10.0.0"
const ProtocolVersion = "v10.0.0"

// BotVersion and BotGitCommit are set by go build -ldflags
BotVersion = ""
BotGitCommit = ""
)
var (
// AppVersion is set by go build -ldflags
AppVersion = ""

// var (
// // BotVersion and BotGitCommit are set by go build -ldflags
// BotVersion string
// BotGitCommit string
// )
// AppGitCommit is set by go build -ldflags
AppGitCommit = ""
)
4 changes: 2 additions & 2 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ fi
# Load the constants
source "$CAMINOBOT_PATH"/scripts/constants.sh

LDFLAGS="-X github.com/chain4travel/camino-messenger-bot/cmd.GitCommit=$git_commit"
LDFLAGS="$LDFLAGS -X github.com/chain4travel/camino-messenger-bot/cmd.Version=$git_tag"
LDFLAGS="-X github.com/chain4travel/camino-messenger-bot/internal/constants.AppGitCommit=$git_commit"
LDFLAGS="$LDFLAGS -X github.com/chain4travel/camino-messenger-bot/internal/constants.AppVersion=$git_tag"

# Build the Go application
echo "Building camino-messenger-bot..."
Expand Down

0 comments on commit a7e3068

Please sign in to comment.