提交 11db8f42 作者: Jeromy

fuse: make osxfuse check config check more permissive

License: MIT
Signed-off-by: 's avatarJeromy <why@ipfs.io>
上级 1a4361e7
...@@ -109,7 +109,7 @@ trying to run these checks with: ...@@ -109,7 +109,7 @@ trying to run these checks with:
[3]: %s [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: You may be able to get this error to go away by setting it again:
ipfs config %s true ipfs config %s true
...@@ -221,12 +221,15 @@ func userAskedToSkipFuseCheck(node *core.IpfsNode) (skip bool, err error) { ...@@ -221,12 +221,15 @@ func userAskedToSkipFuseCheck(node *core.IpfsNode) (skip bool, err error) {
if err != nil { if err != nil {
return false, nil // failed to get config value. dont skip check. 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... // got config value, but it's invalid... dont skip check, ask the user to fix it...
return false, fmt.Errorf(errStrFixConfig, dontCheckOSXFUSEConfigKey, val, return false, fmt.Errorf(errStrFixConfig, dontCheckOSXFUSEConfigKey, val,
dontCheckOSXFUSEConfigKey) dontCheckOSXFUSEConfigKey)
} }
// only "true" counts as telling us to skip.
return s == "true", nil
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论