Commit c99e9e60 authored by Brian Tiger Chow's avatar Brian Tiger Chow Committed by Juan Batiz-Benet

feat(details) add funcs to negate negations

not immediately useful, but nice to have

tagging you to make sure i didn't make a mistake here @jbenet

License: MIT
Signed-off-by: default avatarBrian Tiger Chow <brian@perfmode.com>
parent 5c4fa5a7
......@@ -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
......
......@@ -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
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment