Skip to content

Commit

Permalink
Merge pull request #10 from binqry/release
Browse files Browse the repository at this point in the history
Feature: Provide default index server https://binqry.github.io/index/
  • Loading branch information
progrhyme committed Jul 15, 2020
2 parents b91b5ac + 1a4706c commit 063c3ec
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 8 deletions.
7 changes: 4 additions & 3 deletions binq.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package binq

const (
Version = "0.7.0"
EnvKeyServer = "BINQ_SERVER" // URL of Index Server for install operation
EnvKeyBinDir = "BINQ_BIN_DIR" // Default location to download items
Version = "0.7.0"
DefaultBinqServer = "https://binqry.github.io/index/"
EnvKeyServer = "BINQ_SERVER" // URL of Index Server for install operation
EnvKeyBinDir = "BINQ_BIN_DIR" // Default location to download items
)
4 changes: 3 additions & 1 deletion client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import (
"runtime"
"strings"

"github.com/mholt/archiver/v3"
"github.com/binqry/binq"
"github.com/binqry/binq/internal/erron"
"github.com/binqry/binq/schema/item"
"github.com/mholt/archiver/v3"
"github.com/progrhyme/go-lv"
)

Expand Down Expand Up @@ -77,6 +77,8 @@ func Run(opt RunOption) (err error) {
urlStr = opt.ServerURL
} else if server := os.Getenv(binq.EnvKeyServer); server != "" {
urlStr = server
} else {
urlStr = binq.DefaultBinqServer
}
if urlStr != "" {
uri, _err := url.Parse(urlStr)
Expand Down
1 change: 0 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ github.com/golang/gddo v0.0.0-20190419222130-af0f2af80721 h1:KRMr9A3qfbVM7iV/WcL
github.com/golang/gddo v0.0.0-20190419222130-af0f2af80721/go.mod h1:xEhNfoBDX1hzLm2Nf80qUvZ2sVwoMZ8d6IE2SrsQfh4=
github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4=
github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.5.0 h1:/QaMHBdZ26BB3SSst0Iwl10Epc+xhTquomWX0oZEB6w=
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
Expand Down
2 changes: 1 addition & 1 deletion internal/cli/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"io"
"strings"

"github.com/binqry/binq/internal/erron"
"github.com/gookit/color"
"github.com/pmezard/go-difflib/difflib"
"github.com/binqry/binq/internal/erron"
"golang.org/x/crypto/ssh/terminal"
)

Expand Down
5 changes: 5 additions & 0 deletions internal/cli/modify.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@ func (cmd *modifyCmd) run(args []string) (exit int) {

oldPathItem = filepath.Join(filepath.Dir(fileIndex), oldPathItem)
newPathItem = filepath.Join(filepath.Dir(fileIndex), newPathItem)
newDir := filepath.Dir(newPathItem)
if err = os.MkdirAll(newDir, 0755); err != nil {
fmt.Fprintf(cmd.errs, "Error! Can't make directory: %s. %v\n", newDir, err)
return exitNG
}
if err = os.Rename(oldPathItem, newPathItem); err != nil {
fmt.Fprintf(cmd.errs, "Error! Failed to move file: %s => %s. %v\n", oldPathItem, newPathItem, err)
return exitNG
Expand Down
2 changes: 1 addition & 1 deletion internal/cli/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (
"strings"
"text/template"

"github.com/progrhyme/go-lv"
"github.com/binqry/binq/schema"
"github.com/binqry/binq/schema/item"
"github.com/progrhyme/go-lv"
"github.com/spf13/pflag"
)

Expand Down
2 changes: 1 addition & 1 deletion schema/item/item.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"encoding/json"
"fmt"

"github.com/hashicorp/go-version"
"github.com/binqry/binq/internal/erron"
"github.com/hashicorp/go-version"
"github.com/progrhyme/go-lv"
)

Expand Down

0 comments on commit 063c3ec

Please sign in to comment.