Skip to content

Commit

Permalink
Fixed correct display not exists page
Browse files Browse the repository at this point in the history
  • Loading branch information
HardDie committed May 27, 2021
1 parent 8b0ed09 commit 788c141
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
myTldr-*
21 changes: 11 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
PACKAGE=myTldr
VERSION=0.7

linters:
golangci-lint run --disable-all \
Expand Down Expand Up @@ -31,21 +32,21 @@ linters:
all: linux-386 linux-amd64 linux-arm linux-arm64 darwin-amd64

linux-386:
GOOS=linux GOARCH=386 go build -o ${PACKAGE}-linux-386
tar -czf ${PACKAGE}-linux-386.tar.gz ${PACKAGE}-linux-386
GOOS=linux GOARCH=386 go build -o ${PACKAGE}-${VERSION}-linux-386
tar -czf ${PACKAGE}-${VERSION}-linux-386.tar.gz ${PACKAGE}-${VERSION}-linux-386

linux-amd64:
GOOS=linux GOARCH=amd64 go build -o ${PACKAGE}-linux-amd64
tar -czf ${PACKAGE}-linux-amd64.tar.gz ${PACKAGE}-linux-amd64
GOOS=linux GOARCH=amd64 go build -o ${PACKAGE}-${VERSION}-linux-amd64
tar -czf ${PACKAGE}-${VERSION}-linux-amd64.tar.gz ${PACKAGE}-${VERSION}-linux-amd64

linux-arm:
GOOS=linux GOARCH=arm go build -o ${PACKAGE}-linux-arm
tar -czf ${PACKAGE}-linux-arm.tar.gz ${PACKAGE}-linux-arm
GOOS=linux GOARCH=arm go build -o ${PACKAGE}-${VERSION}-linux-arm
tar -czf ${PACKAGE}-${VERSION}-linux-arm.tar.gz ${PACKAGE}-${VERSION}-linux-arm

linux-arm64:
GOOS=linux GOARCH=arm64 go build -o ${PACKAGE}-linux-arm64
tar -czf ${PACKAGE}-linux-arm64.tar.gz ${PACKAGE}-linux-arm64
GOOS=linux GOARCH=arm64 go build -o ${PACKAGE}-${VERSION}-linux-arm64
tar -czf ${PACKAGE}-${VERSION}-linux-arm64.tar.gz ${PACKAGE}-${VERSION}-linux-arm64

darwin-amd64:
GOOS=darwin GOARCH=amd64 go build -o ${PACKAGE}-darwin-amd64
tar -czf ${PACKAGE}-darwin-amd64.tar.gz ${PACKAGE}-darwin-amd64
GOOS=darwin GOARCH=amd64 go build -o ${PACKAGE}-${VERSION}-darwin-amd64
tar -czf ${PACKAGE}-${VERSION}-darwin-amd64.tar.gz ${PACKAGE}-${VERSION}-darwin-amd64
3 changes: 3 additions & 0 deletions cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ func checkCache(cfg *Config, name string) (page []string, err error) {
break
}

if err != nil {
return
}
// Split data to lines
page = strings.Split(data, "\n")
return
Expand Down
7 changes: 6 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,12 @@ func main() {
// Try to find page in official repository
page, err = checkRemote(cfg, command)
if err != nil {
log.Fatal(err)
switch err {
case ErrorPageNotExists:
// Do nothing
default:
log.Fatal(err)
}
}
if len(page) > 0 {
fmt.Println(GrayString("[global]"))
Expand Down
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package main

var (
VERSION = "0.6"
VERSION = "0.7"
)

func getVersion() string {
Expand Down

0 comments on commit 788c141

Please sign in to comment.