Skip to content

Commit

Permalink
Update to evedDBTool 0.0.6
Browse files Browse the repository at this point in the history
- Fixes #1
- Added makefile for easy cross compilation
- Added auto versioning scheme
  • Loading branch information
jdhirst committed Jan 23, 2023
1 parent f340ff8 commit 2ab3897
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
evedb.yaml
base/
migrations/
EVEDBTool
EVEDBTool
bin/
33 changes: 33 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Makefile for the building of the daemon and production of a PSF package for installation on PLDist

TAG_COMMIT := $(shell git rev-list --abbrev-commit --tags --max-count=1)
TAG := $(shell git describe --abbrev=0 --tags ${TAG_COMMIT} 2>/dev/null || true)
COMMIT := $(shell git rev-parse --short HEAD)
DATE := $(shell git log -1 --format=%cd --date=format:"%Y%m%d")
VERSION := $(TAG:v%=%)
ifneq ($(COMMIT), $(TAG_COMMIT))
VERSION := $(VERSION)-next-$(COMMIT)-$(DATE)
endif
ifeq ($(VERSION),)
VERSION := $(COMMIT)-$(DATA)
endif
ifneq ($(shell git status --porcelain),)
VERSION := $(VERSION)-dirty
endif

# Linker flags for go build
FLAGS := -ldflags "-X main.version=$(VERSION)"

default: clean linux-amd64 linux-arm64 windows-amd64

clean:
rm -rf ./bin

linux-amd64:
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build $(FLAGS) -o bin/evedbtool .

linux-arm64:
GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build $(FLAGS) -o bin/evedb_aarch64 .

windows-amd64:
GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build $(FLAGS) -o bin/evedbtool.exe .
2 changes: 1 addition & 1 deletion dungeon.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ func ImportDungeon(data []byte, overwrite bool) int {

// Insert rooms
for _, room := range dungeon.Rooms {
roomQuery := `INSERT INTO dunRooms (dungeonID, roomID, roomName) VALUES (?,?,?) RETURNING roomID`
roomQuery := `INSERT INTO dunRooms (dungeonID, roomID, roomName) VALUES (?,?,?)`
log.Trace("QUERY: ", roomQuery)
if _, err := db.Exec(roomQuery, dungeonID, roomID, room.RoomName); err != nil {
log.Fatal("Failed to query db; ", err)
Expand Down
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ func main() {

var ui cli.Ui

var version = "dev"

func realMain() int {
//Define version and print on startup
version := "0.0.5"
log.Info("EVEDBTool ", version)

//Initialize config, logging and closehandler
Expand Down

0 comments on commit 2ab3897

Please sign in to comment.