Skip to content

Commit

Permalink
Merge pull request #12 from essentialkaos/develop
Browse files Browse the repository at this point in the history
Version 1.1.1
  • Loading branch information
andyone authored Jun 12, 2019
2 parents 6352547 + 54aad8d commit 23a98cd
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 15 deletions.
26 changes: 17 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
################################################################################

# This Makefile generated by GoMakeGen 1.1.0 using next command:
# gomakegen .
#
# More info: https://kaos.sh/gomakegen

################################################################################

.DEFAULT_GOAL := help
.PHONY = fmt all clean deps gen-fuzz deps-test test help
.PHONY = fmt all clean git-config deps deps-test test gen-fuzz help

################################################################################

Expand All @@ -10,10 +17,10 @@ all: bibop ## Build all binaries
bibop: ## Build bibop binary
go build bibop.go

install: ## Install binaries
install: ## Install all binaries
cp bibop /usr/bin/bibop

uninstall: ## Uninstall binaries
uninstall: ## Uninstall all binaries
rm -f /usr/bin/bibop

git-config: ## Configure git redirects for stable import path services
Expand All @@ -22,26 +29,27 @@ git-config: ## Configure git redirects for stable import path services
deps: git-config ## Download dependencies
go get -d -v pkg.re/essentialkaos/ek.v10

deps-test: ## Download dependencies for tests
git config --global http.https://pkg.re.followRedirects true
deps-test: git-config ## Download dependencies for tests
go get -d -v pkg.re/check.v1

test: ## Run tests
go test -covermode=count ./parser ./recipe

fmt: ## Format source code with gofmt
find . -name "*.go" -exec gofmt -s -w {} \;

gen-fuzz: ## Generate archives for fuzz testing
which go-fuzz-build &>/dev/null || go get -u -v github.com/dvyukov/go-fuzz/go-fuzz-build
go-fuzz-build -o parser-fuzz.zip github.com/essentialkaos/bibop/parser

fmt: ## Format source code with gofmt
find . -name "*.go" -exec gofmt -s -w {} \;

clean: ## Remove generated files
rm -f bibop

help: ## Show this info
@echo -e '\nSupported targets:\n'
@echo -e '\n\033[1mSupported targets:\033[0m\n'
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
| awk 'BEGIN {FS = ":.*?## "}; {printf " \033[33m%-12s\033[0m %s\n", $$1, $$2}'
@echo -e ''
@echo -e '\033[90mGenerated by GoMakeGen 1.1.0\033[0m\n'

################################################################################
2 changes: 1 addition & 1 deletion action/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,5 +109,5 @@ func BackupRestore(action *recipe.Action, tmpDir string) error {
// calcCRC32Q calculate CRC32 checksum
func calcCRC32Q(data string) string {
table := crc32.MakeTable(0xD5828281)
return fmt.Sprint("%08x", crc32.Checksum([]byte(data), table))
return fmt.Sprintf("%08x", crc32.Checksum([]byte(data), table))
}
4 changes: 2 additions & 2 deletions action/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,11 @@ func HTTPHeader(action *recipe.Action) error {
switch {
case !action.Negative && !isHeaderPresent:
return fmt.Errorf(
"HTTP request returns different header (%d ≠ %d)",
"HTTP request returns different header (%s ≠ %s)",
fmtValue(resp.Header.Get(headerName)), headerValue,
)
case action.Negative && isHeaderPresent:
return fmt.Errorf("HTTP request return invalid header (%d)", headerValue)
return fmt.Errorf("HTTP request return invalid header (%s)", headerValue)
}

return nil
Expand Down
4 changes: 2 additions & 2 deletions action/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ func WaitPID(action *recipe.Action) error {

switch action.Negative {
case false:
return fmt.Errorf("Timeout (%g sec) reached, and PID file %s didn't appear", pidFile)
return fmt.Errorf("Timeout (%g sec) reached, and PID file %s didn't appear", timeout, pidFile)
default:
return fmt.Errorf("Timeout (%g sec) reached, and PID file %s still exists", pidFile)
return fmt.Errorf("Timeout (%g sec) reached, and PID file %s still exists", timeout, pidFile)
}
}

Expand Down
2 changes: 1 addition & 1 deletion cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
// Application info
const (
APP = "bibop"
VER = "1.1.0"
VER = "1.1.1"
DESC = "Utility for testing command-line tools"
)

Expand Down

0 comments on commit 23a98cd

Please sign in to comment.