mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-25 12:27:43 +08:00
Merge pull request #775 from jbenet/fix/repo-tilde
have repo tilde expand paths
This commit is contained in:
commit
d4d3e29106
@ -16,6 +16,7 @@ import (
|
||||
lockfile "github.com/jbenet/go-ipfs/repo/fsrepo/lock"
|
||||
serialize "github.com/jbenet/go-ipfs/repo/fsrepo/serialize"
|
||||
dir "github.com/jbenet/go-ipfs/thirdparty/dir"
|
||||
u "github.com/jbenet/go-ipfs/util"
|
||||
debugerror "github.com/jbenet/go-ipfs/util/debugerror"
|
||||
)
|
||||
|
||||
@ -145,6 +146,12 @@ func (r *FSRepo) Open() error {
|
||||
packageLock.Lock()
|
||||
defer packageLock.Unlock()
|
||||
|
||||
expPath, err := u.TildeExpansion(r.path)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
r.path = expPath
|
||||
|
||||
if r.state != unopened {
|
||||
return debugerror.Errorf("repo is %s", r.state)
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user