@cryptotaxi247 / kubo / commits / 11db8f425

fuse: make osxfuse check config check more permissive

License: MIT Signed-off-by: Jeromy <why@ipfs.io>

Jeromy committed Aug 18, 2016 at 12:26 UTC 11db8f425c77b8eaa8f6c8d78b9122be487847ef
1 file changed +8 -5
fuse/node/mount_darwin.go
+8 -5
@@ -109,7 +109,7 @@ trying to run these checks with:
109 [3]: %s
110 `
111
112 -var errStrFixConfig = `config key invalid: %s %s
112 +var errStrFixConfig = `config key invalid: %s %v
113 You may be able to get this error to go away by setting it again:
114
115 ipfs config %s true
@@ -221,12 +221,15 @@ func userAskedToSkipFuseCheck(node *core.IpfsNode) (skip bool, err error) {
221 if err != nil {
222 return false, nil // failed to get config value. dont skip check.
223 }
224 - s, ok := val.(string)
225 - if !ok {
224 +
225 + switch val := val.(type) {
226 + case string:
227 + return val == "true", nil
228 + case bool:
229 + return val, nil
230 + default:
231 // got config value, but it's invalid... dont skip check, ask the user to fix it...
232 return false, fmt.Errorf(errStrFixConfig, dontCheckOSXFUSEConfigKey, val,
233 dontCheckOSXFUSEConfigKey)
234 }
230 - // only "true" counts as telling us to skip.
231 - return s == "true", nil
235 }