We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f83b3c8 commit 77099a8Copy full SHA for 77099a8
1 file changed
icmd/command.go
@@ -208,10 +208,7 @@ func Command(command string, args ...string) Cmd {
208
209
// RunCmd runs a command and returns a Result
210
func RunCmd(cmd Cmd, cmdOperators ...CmdOp) *Result {
211
- for _, op := range cmdOperators {
212
- op(&cmd)
213
- }
214
- result := StartCmd(cmd)
+ result := StartCmd(cmd, cmdOperators...)
215
if result.Error != nil {
216
return result
217
}
@@ -224,7 +221,10 @@ func RunCommand(command string, args ...string) *Result {
224
221
225
222
226
223
// StartCmd starts a command, but doesn't wait for it to finish
227
-func StartCmd(cmd Cmd) *Result {
+func StartCmd(cmd Cmd, cmdOperators ...CmdOp) *Result {
+ for _, op := range cmdOperators {
+ op(&cmd)
+ }
228
result := buildCmd(cmd)
229
230
0 commit comments