Skip to content

Commit

Permalink
Merge pull request #3098 from ipfs/fix/fuse/osx-cfg-check
Browse files Browse the repository at this point in the history
fuse: make osxfuse check config check more permissive
  • Loading branch information
whyrusleeping authored Aug 22, 2016
2 parents 8ffab98 + 11db8f4 commit 4cffc8d
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions fuse/node/mount_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ trying to run these checks with:
[3]: %s
`

var errStrFixConfig = `config key invalid: %s %s
var errStrFixConfig = `config key invalid: %s %v
You may be able to get this error to go away by setting it again:
ipfs config %s true
Expand Down Expand Up @@ -221,12 +221,15 @@ func userAskedToSkipFuseCheck(node *core.IpfsNode) (skip bool, err error) {
if err != nil {
return false, nil // failed to get config value. dont skip check.
}
s, ok := val.(string)
if !ok {

switch val := val.(type) {
case string:
return val == "true", nil
case bool:
return val, nil
default:
// got config value, but it's invalid... dont skip check, ask the user to fix it...
return false, fmt.Errorf(errStrFixConfig, dontCheckOSXFUSEConfigKey, val,
dontCheckOSXFUSEConfigKey)
}
// only "true" counts as telling us to skip.
return s == "true", nil
}

0 comments on commit 4cffc8d

Please sign in to comment.