diff --git a/cmd/ipfs2/ipfs.go b/cmd/ipfs2/ipfs.go index e12d60376..402ce55a7 100644 --- a/cmd/ipfs2/ipfs.go +++ b/cmd/ipfs2/ipfs.go @@ -55,6 +55,10 @@ type cmdDetails struct { doesNotUseRepo bool } +func (d *cmdDetails) canRunOnClient() bool { return !d.cannotRunOnClient } +func (d *cmdDetails) canRunOnDaemon() bool { return !d.cannotRunOnDaemon } +func (d *cmdDetails) usesRepo() bool { return !d.doesNotUseRepo } + // "What is this madness!?" you ask. Our commands have the unfortunate problem of // not being able to run on all the same contexts. This map describes these // properties so that other code can make decisions about whether to invoke a diff --git a/cmd/ipfs2/main.go b/cmd/ipfs2/main.go index 800fe6d3c..f394ec980 100644 --- a/cmd/ipfs2/main.go +++ b/cmd/ipfs2/main.go @@ -281,7 +281,7 @@ func commandShouldRunOnDaemon(req cmds.Request, root *cmds.Command) (bool, error return false, fmt.Errorf("command disabled: %s", path[0]) } - if details.doesNotUseRepo && !details.cannotRunOnClient { + if details.doesNotUseRepo && details.canRunOnClient() { return false, nil }