Starts regular version numbering and removes git call from makefile

This commit is contained in:
sloum 2022-04-25 22:36:12 -07:00
parent 2ccdefb756
commit a9418956b5
4 changed files with 7 additions and 12 deletions

View File

@ -7,16 +7,14 @@ DATAROOTDIR := ${PREFIX}/share
LIBDIR := ${PREFIX}/lib
MANDIR := ${DATAROOTDIR}/man
MAN1DIR := ${MANDIR}/man1
VERSION := $(shell git rev-list HEAD --count)
VERSION_HASH := $(shell git rev-list -1 HEAD)
.PHONY: build
build:
${GOCMD} build -ldflags "-w -s -X main.VersionHash=${VERSION_HASH}" -o ${BINARY}
${GOCMD} build -ldflags "-w -s" -o ${BINARY}
.PHONY: gui
gui:
${GOCMD} build -tags gui -ldflags "-w -s -X main.VersionHash=${VERSION_HASH}" -o ${BINARY}
${GOCMD} build -tags gui -ldflags "-w -s" -o ${BINARY}
.PHONY: install
install: install-bin install-man install-module-dir clean

View File

@ -2,7 +2,7 @@
package main
const guiIsOn = "(gui)"
const guiIsOn = "(+gui)"
var guiUsageStrings = map[string]string{
"dialog-error": "(dialog-error [gui-root] [window-name: string] [error: string]) => ()\n\nShows an error message. The dialog that is opened is not a system native dialog and will be constrained by the window size",

View File

@ -14,12 +14,13 @@ import (
ln "github.com/peterh/liner"
)
const version = "0.5.0"
const globalLibPath = "/usr/local/lib/slope/modules/"
var openFiles []*IOHandle
var replCounter int = 0
var line *ln.State
var VersionHash string
var initialTerm ln.ModeApplier = nil
var linerTerm ln.ModeApplier = nil
var panicOnException = true // default to `(exception-mode-panic)`
@ -247,11 +248,7 @@ func prompt(l *ln.State, cont bool) string {
func PrintVersion() {
logo := "\033[7m┌─┐┬ ┌─┐┌─┐┌─┐\033[0m\n\033[7m└─┐│ │ │├─┘├┤ \033[0m\n\033[7m└─┘┴─┘└─┘┴ └─┘\033[0m"
if VersionHash != "" {
fmt.Printf("\033[1m%s\033[0m\nBuild Version Hash/Commit: %s %s\n(c) 2021 sloum, see license with: (license)\n", logo, VersionHash, guiIsOn)
} else {
fmt.Printf("\033[1m%s\033[0m\nBuild Version Hash/Commit: Custom Build (not hash based)\n(c) 2021 sloum, see license with: \033[1m(license)\033[0m\n", logo)
}
fmt.Printf("\033[1m%s\033[0m\nVersion: %s %s\n(c) 2021 sloum, see license with: (license)\n", logo, version, guiIsOn)
}
func main() {

View File

@ -2,6 +2,6 @@
package main
const guiIsOn = "(no gui)"
const guiIsOn = "()"
var guiUsageStrings = map[string]string{}