Skip to content

Commit 46a91fd

Browse files
committed
fix: version var in make file
1 parent 8f826e6 commit 46a91fd

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ DEFAULT_VERSION=0.1.0-local
22
VERSION := $(or $(VERSION),$(DEFAULT_VERSION))
33

44
cmd:
5-
cd server && go build -ldflags "-w -X main.Version=$(VERSION)" -o '../build/server'
5+
cd server && go build -ldflags "-w -X main.VERSION=$(VERSION)" -o '../build/server'
66
clean:
77
rm -rf build
88
test:

server/env/env.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import (
1212

1313
// build variables
1414
var (
15-
VERSION string
1615
ARG_DB_URL *string
1716
ARG_DB_TYPE *string
1817
ARG_AUTHORIZER_URL *string
@@ -34,8 +33,6 @@ func InitEnv() {
3433
log.Printf("error loading %s file", constants.ENV_PATH)
3534
}
3635

37-
constants.VERSION = VERSION
38-
3936
if constants.ADMIN_SECRET == "" {
4037
constants.ADMIN_SECRET = os.Getenv("ADMIN_SECRET")
4138
if constants.ADMIN_SECRET == "" {

server/main.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,17 @@ import (
1313
"github.com/authorizerdev/authorizer/server/utils"
1414
)
1515

16+
var VERSION string
17+
1618
func main() {
1719
env.ARG_DB_URL = flag.String("database_url", "", "Database connection string")
1820
env.ARG_DB_TYPE = flag.String("database_type", "", "Database type, possible values are postgres,mysql,sqlite")
1921
env.ARG_AUTHORIZER_URL = flag.String("authorizer_url", "", "URL for authorizer instance, eg: https://xyz.herokuapp.com")
2022
env.ARG_ENV_FILE = flag.String("env_file", "", "Env file path")
2123
flag.Parse()
2224

25+
constants.VERSION = VERSION
26+
2327
env.InitEnv()
2428
db.InitDB()
2529
session.InitSession()

0 commit comments

Comments
 (0)