File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -261,8 +261,12 @@ module.exports = grunt => {
261261 . catch ( ( ) => performConditionalBranch ( command . else , false )
262262 . then ( resolve , reject ) )
263263 } )
264- promise . finally ( ( ) => grunt . output . writeln ( 'The conditional command ended.' ) )
264+ promise . then ( reportEnd , reportEnd )
265265 return promise
266+
267+ function reportEnd ( ) {
268+ grunt . output . writeln ( 'The conditional command ended.' )
269+ }
266270 }
267271
268272 function performConditionalBranch ( branch , result ) {
@@ -379,14 +383,16 @@ module.exports = grunt => {
379383
380384 return function ( promise ) {
381385 if ( promise instanceof Promise ) {
382- promise . finally ( ( ) => {
383- clearTimeout ( timer )
384- grunt . output . writeln ( 'The loop ended.' )
385- } )
386+ promise . then ( finishLoop , finishLoop )
386387 } else {
387388 rejectAll = promise
388389 }
389390 }
391+
392+ function finishLoop ( ) {
393+ clearTimeout ( timer )
394+ grunt . output . writeln ( 'The loop ended.' )
395+ }
390396 }
391397
392398 function performCommands ( subCommands ) {
You can’t perform that action at this time.
0 commit comments