Skip to content

Commit

Permalink
fix(use): Fix qri get with no args bug. Bump version.
Browse files Browse the repository at this point in the history
  • Loading branch information
dustmop committed Jul 3, 2019
1 parent 8286730 commit aaf295e
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 16 deletions.
Binary file modified api/testdata/api.snapshot
Binary file not shown.
12 changes: 3 additions & 9 deletions cmd/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,9 @@ func (o *GetOptions) Complete(f Factory, args []string) (err error) {
args = args[1:]
}
}
o.Refs = make([]string, 0, len(args))
for i := range args {
var ref string
ref, err = GetDatasetRefString(f, args, i)
if err != nil {
return
}
o.Refs = append(o.Refs, ref)
}
// TODO(dlong): Add tests to cmd_test for `use`.
o.Refs = make([]string, 1)
o.Refs[0], err = GetDatasetRefString(f, args, 0)
if o.DatasetRequests, err = f.DatasetRequests(); err != nil {
return
}
Expand Down
9 changes: 5 additions & 4 deletions cmd/get_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@ func TestGetComplete(t *testing.T) {
refs []string
err string
}{
{[]string{}, "", []string{}, ""},
{[]string{}, "", []string{""}, ""},
{[]string{"one arg"}, "", []string{"one arg"}, ""},
{[]string{"commit", "peer/ds"}, "commit", []string{"peer/ds"}, ""},
{[]string{"commit.author", "peer/ds"}, "commit.author", []string{"peer/ds"}, ""},
{[]string{"peer/ds_two", "peer/ds"}, "", []string{"peer/ds_two", "peer/ds"}, ""},
{[]string{"foo", "peer/ds"}, "", []string{"foo", "peer/ds"}, ""},
{[]string{"structure"}, "structure", []string{}, ""},
// TODO(dlong): Fix tests when `qri get` can be passed multiple arguments.
//{[]string{"peer/ds_two", "peer/ds"}, "", []string{"peer/ds_two", "peer/ds"}, ""},
//{[]string{"foo", "peer/ds"}, "", []string{"foo", "peer/ds"}, ""},
{[]string{"structure"}, "structure", []string{""}, ""},
{[]string{"peer/human_body_facts"}, "", []string{"peer/human_body_facts"}, ""},
}

Expand Down
3 changes: 2 additions & 1 deletion cmd/use.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ func (o *UseOptions) Run() (err error) {
if o.List {
refs, err = readFile(fileSelectionPath)
if err != nil {
return err
// File not exist, or can't parse: not an error, just don't show anything.
return nil
}
} else if o.Clear {
err := writeFile(fileSelectionPath, refs)
Expand Down
2 changes: 1 addition & 1 deletion lib/lib.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ var (
)

// VersionNumber is the current version qri
const VersionNumber = "0.8.2"
const VersionNumber = "0.8.3-dev"

func init() {
// Fields like dataset.Structure.Schema contain data of arbitrary types,
Expand Down
2 changes: 1 addition & 1 deletion p2p/p2p.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const (
// QriProtocolID is the top level Protocol Identifier
QriProtocolID = protocol.ID("/qri")
// QriServiceTag tags the type & version of the qri service
QriServiceTag = "qri/0.8.2"
QriServiceTag = "qri/0.8.3-dev"
// default value to give qri peer connections in connmanager, one hunnit
qriSupportValue = 100
// qriSupportKey is the key we store the flag for qri support under in Peerstores and in ConnManager()
Expand Down

0 comments on commit aaf295e

Please sign in to comment.