File tree 2 files changed +13
-6
lines changed
2 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -15,8 +15,9 @@ import (
15
15
)
16
16
17
17
const (
18
- hookFileMode = 0o755
19
- envVerbose = "LEFTHOOK_VERBOSE" // keep all output
18
+ hookFileMode = 0o755
19
+ envVerbose = "LEFTHOOK_VERBOSE" // keep all output
20
+ oldHookPostfix = ".old"
20
21
)
21
22
22
23
var lefthookContentRegexp = regexp .MustCompile ("LEFTHOOK" )
@@ -94,7 +95,7 @@ func (l *Lefthook) cleanHook(hook string, force bool) error {
94
95
}
95
96
96
97
// Check if .old file already exists before renaming.
97
- exists , err = afero .Exists (l .Fs , hookPath + ".old" )
98
+ exists , err = afero .Exists (l .Fs , hookPath + oldHookPostfix )
98
99
if err != nil {
99
100
return err
100
101
}
@@ -107,7 +108,7 @@ func (l *Lefthook) cleanHook(hook string, force bool) error {
107
108
}
108
109
}
109
110
110
- err = l .Fs .Rename (hookPath , hookPath + ".old" )
111
+ err = l .Fs .Rename (hookPath , hookPath + oldHookPostfix )
111
112
if err != nil {
112
113
return err
113
114
}
Original file line number Diff line number Diff line change @@ -181,9 +181,15 @@ func printSummary(
181
181
results []run.Result ,
182
182
logSettings log.SkipSettings ,
183
183
) {
184
+ summaryPrint := log .Separate
185
+
186
+ if logSettings .SkipExecution () || (logSettings .SkipExecutionInfo () && logSettings .SkipExecutionOutput ()) {
187
+ summaryPrint = func (s string ) { log .Info (s ) }
188
+ }
189
+
184
190
if len (results ) == 0 {
185
191
if ! logSettings .SkipEmptySummary () {
186
- log . Separate (
192
+ summaryPrint (
187
193
fmt .Sprintf (
188
194
"%s %s %s" ,
189
195
log .Cyan ("summary:" ),
@@ -195,7 +201,7 @@ func printSummary(
195
201
return
196
202
}
197
203
198
- log . Separate (
204
+ summaryPrint (
199
205
log .Cyan ("summary: " ) + log .Gray (fmt .Sprintf ("(done in %.2f seconds)" , duration .Seconds ())),
200
206
)
201
207
You can’t perform that action at this time.
0 commit comments