fix README + add version
This commit is contained in:
parent
bfaf6f10c6
commit
57834a1b3c
8
Makefile
8
Makefile
@ -1,15 +1,15 @@
|
||||
BIN_NAME = "hmdeploy"
|
||||
BIN_INSTALL = $(shell whereis $(BIN_NAME) | cut -d ' ' -f2 | xargs rm -f)
|
||||
|
||||
run: lint
|
||||
@go run main.go
|
||||
|
||||
build: lint
|
||||
@echo "building binary..."
|
||||
@go build -o $(BIN_NAME) main.go && echo "$(BIN_NAME) built"
|
||||
@go build -ldflags "-X main.Version=0.1.0" -o $(BIN_NAME) main.go && echo "$(BIN_NAME) built"
|
||||
|
||||
install:
|
||||
@$(shell whereis $(BIN_NAME) | cut -d ' ' -f2 | xargs rm -f)
|
||||
@go install
|
||||
install: build
|
||||
@mv $(BIN_NAME) $(GOPATH)/bin/hmdeploy
|
||||
@echo "program installed: $(GOPATH)/bin/hmdeploy"
|
||||
|
||||
lint:
|
||||
|
||||
@ -124,10 +124,14 @@ Usage of hmdeploy:
|
||||
show debug logs
|
||||
-destroy
|
||||
delete the deployed project
|
||||
-details
|
||||
extract swarm details and return
|
||||
-no-nginx
|
||||
no Nginx deployment
|
||||
-path string
|
||||
define the .homeserver project root dir (default ".")
|
||||
-version
|
||||
extract swarm details and return
|
||||
|
||||
# if your are in the project dir with a `.homeserver`
|
||||
# you can then launch the program directly
|
||||
|
||||
8
main.go
8
main.go
@ -32,6 +32,8 @@ const (
|
||||
MaxDeployers int = 2
|
||||
)
|
||||
|
||||
var Version string
|
||||
|
||||
var HOME_PATH = os.Getenv("HOME")
|
||||
|
||||
var (
|
||||
@ -343,6 +345,7 @@ func main() { //nolint: funlen //TODO: to reduce
|
||||
noNginx := flag.Bool("no-nginx", false, "no Nginx deployment")
|
||||
debug := flag.Bool("debug", false, "show debug logs")
|
||||
details := flag.Bool("details", false, "extract swarm details and return")
|
||||
version := flag.Bool("version", false, "extract swarm details and return")
|
||||
confirm := flag.Bool(
|
||||
"confirm",
|
||||
false,
|
||||
@ -350,6 +353,11 @@ func main() { //nolint: funlen //TODO: to reduce
|
||||
)
|
||||
flag.Parse()
|
||||
|
||||
if *version {
|
||||
fmt.Println("hmdeploy version: v" + Version)
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
initLogger(*debug)
|
||||
|
||||
hmmap, err := loadHMMap()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user