File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,9 +29,24 @@ $(BUILDDIR):
2929build : $(BUILDDIR )
3030 go build $(GOFLAGS ) $(LDFLAGS ) -o $(BUILDDIR )$(SEP )$(BINARY ) $(CMD )
3131
32- # # install: install to $$GOPATH/bin (or ~/go /bin)
32+ # # install: build and install to $GOBIN (or $GOPATH /bin)
3333install :
3434 go install $(GOFLAGS ) $(LDFLAGS ) $(CMD )
35+ @BIN=" $$ (go env GOBIN)" ; \
36+ if [ -z " $$ BIN" ]; then BIN=" $$ (go env GOPATH)/bin" ; fi ; \
37+ echo " installed: $$ BIN/$( BINARY) " ; \
38+ " $$ BIN/$( BINARY) " --version; \
39+ case " :$$ PATH:" in \
40+ * " $$ BIN" * ) ;; \
41+ * ) echo " WARNING: $$ BIN is not on your PATH, so '$( BINARY) ' will not be found." ; \
42+ echo " Add this to ~/.bashrc or ~/.zshrc, then restart your shell:" ; \
43+ echo " export PATH=\"\$ $PATH :$$ BIN\" " ; ;; \
44+ esac ; \
45+ FOUND=" $$ (command -v $( BINARY) 2>/dev/null || true)" ; \
46+ if [ -n " $$ FOUND" ] && [ " $$ FOUND" != " $$ BIN/$( BINARY) " ]; then \
47+ echo " WARNING: '$$ FOUND' shadows the new binary (shell picks the first match on PATH)." ; \
48+ echo " Remove it or put $$ BIN earlier on PATH to use the new build." ; \
49+ fi
3550
3651# # run: build and run
3752run : build
Original file line number Diff line number Diff line change @@ -33,6 +33,10 @@ brew install programmersd21/flow/flow
3333go install github.com/programmersd21/flow/cmd/flow@latest
3434```
3535
36+ Make sure ` $(go env GOPATH)/bin ` is on your ` PATH ` , otherwise your shell
37+ won't find the new binary (and a stale copy elsewhere can shadow it —
38+ ` make install ` warns about both).
39+
3640or download a binary from [ releases] ( https://github.com/programmersd21/flow/releases ) .
3741
3842## usage
You can’t perform that action at this time.
0 commit comments