Changes for #104

This commit is contained in:
perennial
2024-09-22 00:46:57 +10:00
parent 0489fff340
commit 901286d98e
2 changed files with 6 additions and 4 deletions
+4 -3
View File
@@ -1,6 +1,8 @@
# Git-related files
.git/
.gitignore
# Required for commit hash
# ref: https://codeberg.org/VnPower/PixivFE/pulls/104
# .git/
# .gitignore
# Docker-related files
.dockerignore
@@ -18,4 +20,3 @@ mkdocs.yml
LICENSE
README.md
doc/
+2 -1
View File
@@ -4,6 +4,7 @@
BINARY_NAME=pixivfe
TARGETOS ?= $(shell go env GOOS)
TARGETARCH ?= $(shell go env GOARCH)
GIT_COMMIT := $(shell git describe --always 2>/dev/null)
# Include environment variables from .env if it exists
-include .env
@@ -19,7 +20,7 @@ fmt:
build:
@echo "Building $(BINARY_NAME)..."
go mod download
CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -v -ldflags="-extldflags=-static -X codeberg.org/vnpower/pixivfe/v2/config.REVISION=`git describe --always 2>/dev/null`" -tags netgo -o $(BINARY_NAME)
CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -v -ldflags="-extldflags=-static -X codeberg.org/vnpower/pixivfe/v2/config.REVISION=$(GIT_COMMIT)" -tags netgo -o $(BINARY_NAME)
test:
@echo "Running tests..."