From 4f42cafa5057b04fd25fcd63069d4bf2ae7ecbf0 Mon Sep 17 00:00:00 2001 From: Timothy Date: Sat, 31 Aug 2019 23:36:45 +0800 Subject: [PATCH] update Makefile --- .gitignore | 1 + cmd/Makefile | 5 ----- cmd/main.go | 7 +++++++ lib/version.go | 7 ------- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index 38027bf..1558c23 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ cmd/cmd cmd/glance .DS_Store +cmd/*.tar.gz diff --git a/cmd/Makefile b/cmd/Makefile index 8712752..f119922 100644 --- a/cmd/Makefile +++ b/cmd/Makefile @@ -17,11 +17,6 @@ release: go clean CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -o ${BINARY} -ldflags "-s -w -X main.Version=${VERSION}" tar czvf ${BINARY}-linux64-${VERSION}.tar.gz ./${BINARY} - # Build for win - go clean - CGO_ENABLED=0 GOOS=windows GOARCH=amd64 GO111MODULE=on go build -o ${BINARY}.exe -ldflags "-s -w -X main.Version=${VERSION}" - tar czvf ${BINARY}-win64-${VERSION}.tar.gz ./${BINARY}.exe - go clean # Cleans our projects: deletes binaries clean: go clean diff --git a/cmd/main.go b/cmd/main.go index 841f536..0e75de7 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -6,6 +6,8 @@ import ( "path/filepath" "strings" + "github.com/TimothyYe/glance/lib" + "github.com/TimothyYe/glance/core" "github.com/TimothyYe/glance/reader" ) @@ -21,6 +23,11 @@ func main() { os.Exit(1) } + if len(os.Args) == 2 && os.Args[1] == "-v" { + lib.Display(Version) + os.Exit(0) + } + ext := strings.ToUpper(filepath.Ext(os.Args[1])) // create reader diff --git a/lib/version.go b/lib/version.go index 956fed4..514102a 100644 --- a/lib/version.go +++ b/lib/version.go @@ -5,13 +5,6 @@ import "fmt" var ( // Logo Logo = ` -##### -# # # ## # # #### ###### -# # # # ## # # # # -# #### # # # # # # # ##### -# # # ###### # # # # # -# # # # # # ## # # # - ##### ###### # # # # #### ###### Glance V%s https://github.com/TimothyYe/glance `