File tree Expand file tree Collapse file tree 2 files changed +19
-6
lines changed
Expand file tree Collapse file tree 2 files changed +19
-6
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,14 @@ export CGO_ENABLED=0
2929export GOPROXY=https ://proxy.golang.org
3030
3131.PHONY : all
32- all : update-data update_price fmt lint test-verbose ; $(info $(M ) building $(TARGETOS ) /$(TARGETARCH ) binary...) @ # # Build program binary
32+ all : update-data update-price fmt lint test-verbose ; $(info $(M ) building $(TARGETOS ) /$(TARGETARCH ) binary...) @ # # Build program binary
33+ $Q env GOOS=$(TARGETOS ) GOARCH=$(TARGETARCH ) $(GO ) build \
34+ -tags release \
35+ -ldflags " $( LDFLAGS_VERSION) " \
36+ -o $(BIN ) /$(basename $(MODULE ) ) ./cmd/main.go
37+
38+ .PHONY : build
39+ build : update-data update-price ; $(info $(M ) building $(TARGETOS ) /$(TARGETARCH ) binary...) @ # # Build program binary
3340 $Q env GOOS=$(TARGETOS ) GOARCH=$(TARGETARCH ) $(GO ) build \
3441 -tags release \
3542 -ldflags " $( LDFLAGS_VERSION) " \
@@ -98,8 +105,8 @@ update-data: check-deps; @ ## Update Spot Advisor data file
98105 @wget -nv $(SPOT_ADVISOR_DATA_URL ) -O - > public/spot/data/spot-advisor-data.json
99106 @echo " spot advisor data updated"
100107
101- .PHONY : update_price
102- update_price : check-deps; @ # # Update Spot pricing data file
108+ .PHONY : update-price
109+ update-price : check-deps; @ # # Update Spot pricing data file
103110 @mkdir -p public/spot/data
104111 @wget -nv $(SPOT_PRICE_DATA_URL ) -O - > public/spot/data/spot-price-data.json
105112 @sed -i' ' -e " s/callback(//g" public/spot/data/spot-price-data.json
Original file line number Diff line number Diff line change @@ -236,9 +236,15 @@ func main() {
236236 }
237237 cli .VersionPrinter = func (c * cli.Context ) {
238238 fmt .Printf ("spotinfo %s\n " , Version )
239- fmt .Printf (" Build date: %s\n " , BuildDate )
240- fmt .Printf (" Git commit: %s\n " , GitCommit )
241- fmt .Printf (" Git branch: %s\n " , GitBranch )
239+ if BuildDate != "" && BuildDate != "unknown" {
240+ fmt .Printf (" Build date: %s\n " , BuildDate )
241+ }
242+ if GitCommit != "" {
243+ fmt .Printf (" Git commit: %s\n " , GitCommit )
244+ }
245+ if GitBranch != "" {
246+ fmt .Printf (" Git branch: %s\n " , GitBranch )
247+ }
242248 fmt .Printf (" Built with: %s\n " , runtime .Version ())
243249 }
244250
You can’t perform that action at this time.
0 commit comments