Skip to content

Commit

Permalink
fix(save): qri save without CLI dataset arg
Browse files Browse the repository at this point in the history
  • Loading branch information
b5 committed Jun 8, 2018
1 parent 4caacbf commit 780d734
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions cmd/save.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,14 @@ collaboration are in the works. Sit tight sportsfans.`,
ErrExit(fmt.Errorf("please provide the name of an existing dataset to save updates to, or specify a dataset --file with name and peername"))
}

ref, err := repo.ParseDatasetRef(args[0])
ExitIfErr(err)
var arg string
if len(args) == 1 {
arg = args[0]
}
ref, err := repo.ParseDatasetRef(arg)
if err != nil && saveFilePath == "" {
ErrExit(err)
}

dsp := &dataset.DatasetPod{}
if saveFilePath != "" {
Expand All @@ -83,6 +89,8 @@ collaboration are in the works. Sit tight sportsfans.`,
}
if ref.Peername != "" {
dsp.Peername = ref.Peername
} else if dsp.Peername == "" {
dsp.Peername = "me"
}

if (saveTitle != "" || saveMessage != "") && dsp.Commit == nil {
Expand Down

0 comments on commit 780d734

Please sign in to comment.