mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-05 21:15:38 -05:00
fix: dms-cli & about versioning in all builds
This commit is contained in:
4
Makefile
4
Makefile
@@ -43,6 +43,7 @@ install-shell:
|
|||||||
@mkdir -p $(SHELL_INSTALL_DIR)
|
@mkdir -p $(SHELL_INSTALL_DIR)
|
||||||
@cp -r $(SHELL_DIR)/* $(SHELL_INSTALL_DIR)/
|
@cp -r $(SHELL_DIR)/* $(SHELL_INSTALL_DIR)/
|
||||||
@rm -rf $(SHELL_INSTALL_DIR)/.git* $(SHELL_INSTALL_DIR)/.github
|
@rm -rf $(SHELL_INSTALL_DIR)/.git* $(SHELL_INSTALL_DIR)/.github
|
||||||
|
@$(MAKE) --no-print-directory -C $(CORE_DIR) print-version > $(SHELL_INSTALL_DIR)/VERSION
|
||||||
@echo "Shell files installed"
|
@echo "Shell files installed"
|
||||||
|
|
||||||
install-completions:
|
install-completions:
|
||||||
@@ -80,8 +81,7 @@ install: build install-bin install-shell install-completions install-systemd ins
|
|||||||
@echo ""
|
@echo ""
|
||||||
@echo "Installation complete!"
|
@echo "Installation complete!"
|
||||||
@echo ""
|
@echo ""
|
||||||
@echo "To enable and start DMS:"
|
@echo "=== The DMS Team! ==="
|
||||||
@echo " systemctl --user enable --now dms"
|
|
||||||
|
|
||||||
# Uninstallation targets
|
# Uninstallation targets
|
||||||
uninstall-bin:
|
uninstall-bin:
|
||||||
|
|||||||
@@ -10,16 +10,19 @@ GO=go
|
|||||||
GOFLAGS=-ldflags="-s -w"
|
GOFLAGS=-ldflags="-s -w"
|
||||||
|
|
||||||
# Version and build info
|
# Version and build info
|
||||||
VERSION=$(shell git describe --tags --always 2>/dev/null || echo "dev")
|
BASE_VERSION=$(shell git describe --tags --abbrev=0 2>/dev/null | sed 's/^v//' || echo "0.0.0")
|
||||||
BUILD_TIME=$(shell date -u '+%Y-%m-%d_%H:%M:%S')
|
COMMIT_COUNT=$(shell git rev-list --count HEAD 2>/dev/null || echo "0")
|
||||||
COMMIT=$(shell git rev-parse --short HEAD 2>/dev/null || echo "unknown")
|
COMMIT_HASH=$(shell git rev-parse --short=8 HEAD 2>/dev/null || echo "unknown")
|
||||||
|
VERSION?=$(BASE_VERSION)+git$(COMMIT_COUNT).$(COMMIT_HASH)
|
||||||
|
BUILD_TIME?=$(shell date -u '+%Y-%m-%d_%H:%M:%S')
|
||||||
|
COMMIT?=$(COMMIT_HASH)
|
||||||
|
|
||||||
BUILD_LDFLAGS=-ldflags='-s -w -X main.Version=$(VERSION) -X main.buildTime=$(BUILD_TIME) -X main.commit=$(COMMIT)'
|
BUILD_LDFLAGS=-ldflags='-s -w -X main.Version=$(VERSION) -X main.buildTime=$(BUILD_TIME) -X main.commit=$(COMMIT)'
|
||||||
|
|
||||||
# Architecture to build for dist target (amd64, arm64, or all)
|
# Architecture to build for dist target (amd64, arm64, or all)
|
||||||
ARCH ?= all
|
ARCH ?= all
|
||||||
|
|
||||||
.PHONY: all build dankinstall dist clean install install-all install-dankinstall uninstall uninstall-all uninstall-dankinstall install-config uninstall-config test fmt vet deps help
|
.PHONY: all build dankinstall dist clean install install-all install-dankinstall uninstall uninstall-all uninstall-dankinstall install-config uninstall-config test fmt vet deps print-version help
|
||||||
|
|
||||||
# Default target
|
# Default target
|
||||||
all: build
|
all: build
|
||||||
@@ -132,6 +135,9 @@ version: check-go
|
|||||||
@echo "Build Time: $(BUILD_TIME)"
|
@echo "Build Time: $(BUILD_TIME)"
|
||||||
@echo "Commit: $(COMMIT)"
|
@echo "Commit: $(COMMIT)"
|
||||||
|
|
||||||
|
print-version:
|
||||||
|
@echo "$(VERSION)"
|
||||||
|
|
||||||
help:
|
help:
|
||||||
@echo "Available targets:"
|
@echo "Available targets:"
|
||||||
@echo " all - Build the main binary (dms) (default)"
|
@echo " all - Build the main binary (dms) (default)"
|
||||||
|
|||||||
@@ -162,7 +162,19 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: SystemUpdateService.shellVersion ? `dms ${SystemUpdateService.shellVersion}` : "dms"
|
text: {
|
||||||
|
if (!SystemUpdateService.shellVersion) return "dms";
|
||||||
|
|
||||||
|
// Git versioning to show ex: "dms v0.6.2-2223"
|
||||||
|
let version = SystemUpdateService.shellVersion;
|
||||||
|
let match = version.match(/^([\d.]+)\+git(\d+)\./);
|
||||||
|
|
||||||
|
if (match) {
|
||||||
|
return `dms v${match[1]}-${match[2]}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
return `dms ${version}`;
|
||||||
|
}
|
||||||
font.pixelSize: Theme.fontSizeXLarge
|
font.pixelSize: Theme.fontSizeXLarge
|
||||||
font.weight: Font.Bold
|
font.weight: Font.Bold
|
||||||
color: Theme.surfaceText
|
color: Theme.surfaceText
|
||||||
|
|||||||
Reference in New Issue
Block a user