Skip to content

Commit

Permalink
fuse: make osxfuse check config check more permissive
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
  • Loading branch information
whyrusleeping committed Aug 18, 2016
1 parent 1a4361e commit e78af3e
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 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 {
// got config value, but it's invalid... dont skip check, ask the user to fix it...
return false, fmt.Errorf(errStrFixConfig, dontCheckOSXFUSEConfigKey, val,
dontCheckOSXFUSEConfigKey)
if s, ok := val.(string); ok {
return s == "true", nil
}
// only "true" counts as telling us to skip.
return s == "true", nil

if b, ok := val.(bool); ok {
return b, nil
}

// got config value, but it's invalid... dont skip check, ask the user to fix it...
return false, fmt.Errorf(errStrFixConfig, dontCheckOSXFUSEConfigKey, val,
dontCheckOSXFUSEConfigKey)
}

0 comments on commit e78af3e

Please sign in to comment.