@@ -10,7 +10,7 @@ import (
10
10
)
11
11
12
12
// CtxKeyQuiet is the context key to mute the chain.
13
- var CtxKeyQuiet = struct { quiet bool }{quiet : true }
13
+ var CtxKeyQuiet = struct { key string }{key : "quiet" }
14
14
15
15
// errNonFatal is a non fatal error
16
16
type errNonFatal struct {
@@ -77,6 +77,8 @@ type ActiveCommandChain struct {
77
77
funcs []cFunc
78
78
lastStage string
79
79
log * log.Entry
80
+
81
+ executing bool
80
82
}
81
83
82
84
// Logger returns the logger for the command chain.
@@ -89,6 +91,10 @@ func (a *ActiveCommandChain) Add(f func() error) {
89
91
90
92
// Stage sets the current stage of the runner.
91
93
func (a * ActiveCommandChain ) Stage (s string ) {
94
+ if a .executing {
95
+ a .log .Println (s , "..." )
96
+ return
97
+ }
92
98
a .funcs = append (a .funcs , cFunc {s : s })
93
99
}
94
100
@@ -101,7 +107,10 @@ func (a *ActiveCommandChain) Stagef(format string, s ...interface{}) {
101
107
// Exec executes the command chain.
102
108
// The first errored function terminates the chain and the
103
109
// error is returned. Otherwise, returns nil.
104
- func (a ActiveCommandChain ) Exec () error {
110
+ func (a * ActiveCommandChain ) Exec () error {
111
+ a .executing = true
112
+ defer func () { a .executing = false }()
113
+
105
114
for _ , f := range a .funcs {
106
115
if f .f == nil {
107
116
if f .s != "" {
0 commit comments