diff options
Diffstat (limited to '')
-rw-r--r-- | pkg/commands.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/pkg/commands.go b/pkg/commands.go index 4222de7..e3f6242 100644 --- a/pkg/commands.go +++ b/pkg/commands.go @@ -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 } |