11SHELL := /bin/bash
22
3- NAME := go-alfred-sentence-splitter
4- PACKAGE := sentence-splitter .alfredworkflow
3+ NAME := google-translate-formatter
4+ PACKAGE := $( NAME ) .alfredworkflow
55PLIST := resources/info.plist
66SRCS := $(shell go list -f {{.Dir}} ./... | grep -v /vendor/)
77VERSION := $(shell git describe --tag --abbrev=0 || echo "v0.0.0")
@@ -16,7 +16,7 @@ build: test $(BUILT_TARGET) ;
1616
1717$(BUILT_TARGET ) : $(SRCS )
1818 @echo " Build $( NAME) $( VERSION) "
19- GO111MODULE=on go build $(LDFLAGS ) -o google-translate-formatter .
19+ GO111MODULE=on go build $(LDFLAGS ) -o $( NAME ) .
2020
2121clean :
2222 rm -f $(BUILT_TARGET )
@@ -36,17 +36,17 @@ deps:
3636 go mod download
3737
3838release : test
39- @if [[ ! " $( VER) " =~ ^v ([0-9]\. ){2}[0-9]$$ ]]; then \
40- echo " '$( VER) ' is invalid. Please call this like 'make release VER=v0 .0.0'" ; \
39+ @if [[ ! " $( VER) " =~ ^([0-9]\. ){2}[0-9]$$ ]]; then \
40+ echo " '$( VER) ' is invalid. Please call this like 'make release VER=0 .0.0'" ; \
4141 exit 1; \
4242 fi
43- sed -i ' ' -e " /.*>version<.*/{n;s/v[0-9]\.[0-9]\.[0-9]/$( VER) /;}" $(PLIST )
43+ sed -i ' ' -e " /.*>version<.*/{n;s/v? [0-9]\.[0-9]\.[0-9]/$( VER) /;}" $(PLIST )
4444 git add $(PLIST )
45- git commit -m ' Release $(VER)'
46- git tag $(VER )
45+ git commit -m ' Release v $(VER)'
46+ git tag v $(VER )
4747 # Push this release to remote, please type following command
4848 # $ git push origin $(VER)
49- @echo " $( VER) [OK]"
49+ @echo " v $( VER) [OK]"
5050
5151$(PACKAGE ) : $(BUILT_TARGET )
5252 @if [ ! -d ./dist ]; then \
0 commit comments