Skip to content

Commit

Permalink
fix(checkout): absolutize FSI link creation paths
Browse files Browse the repository at this point in the history
  • Loading branch information
b5 committed Jul 24, 2019
1 parent 073c640 commit 64c3b41
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions lib/fsi.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package lib

import (
"path/filepath"

"github.com/qri-io/qri/fsi"
)

Expand Down Expand Up @@ -39,8 +41,16 @@ type LinkParams struct {

// CreateLink creates a connection between a working drirectory and a dataset history
func (m *FSIMethods) CreateLink(p *LinkParams, res *string) (err error) {
// absolutize path name
path, err := filepath.Abs(p.Dir)
if err != nil {
return err
}

p.Dir = path

if m.inst.rpc != nil {
return m.inst.rpc.Call("FSIMethods.Link", p, res)
return m.inst.rpc.Call("FSIMethods.CreateLink", p, res)
}

fsint := fsi.NewFSI(m.inst.repo, fsi.RepoPath(m.inst.repoPath))
Expand All @@ -51,7 +61,7 @@ func (m *FSIMethods) CreateLink(p *LinkParams, res *string) (err error) {
// UpdateLink creates a connection between a working drirectory and a dataset history
func (m *FSIMethods) UpdateLink(p *LinkParams, res *string) (err error) {
if m.inst.rpc != nil {
return m.inst.rpc.Call("FSIMethods.Link", p, res)
return m.inst.rpc.Call("FSIMethods.UpdateLink", p, res)
}

// TODO (b5) - inst should have an fsi instance
Expand Down

0 comments on commit 64c3b41

Please sign in to comment.