chore(gonf): add a DECLARED promise status and make it the default instead of PROMISED
This commit is contained in:
parent
48f2e9a2cb
commit
00cb3a2488
6 changed files with 49 additions and 21 deletions
|
@ -23,7 +23,7 @@ func CommandWithEnv(env []string, cmd string, args ...string) *CommandPromise {
|
|||
cmd: cmd,
|
||||
env: env,
|
||||
err: nil,
|
||||
status: PROMISED,
|
||||
status: DECLARED,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -44,7 +44,10 @@ func (c *CommandPromise) IfRepaired(p ...Promise) Promise {
|
|||
}
|
||||
|
||||
func (c *CommandPromise) Promise() *CommandPromise {
|
||||
commands = append(commands, c)
|
||||
if c.status == DECLARED {
|
||||
c.status = PROMISED
|
||||
commands = append(commands, c)
|
||||
}
|
||||
return c
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue