@@ -2,9 +2,11 @@ const cac = require('cac')
22const path = require ( 'path' )
33const fs = require ( 'fs' )
44const spawn = require ( 'cross-spawn' )
5+ const ora = require ( 'ora' )
56const parseArgs = require ( '../utils/parseArgs' )
67const logger = require ( '../utils/logger' )
78const matcher = require ( 'multimatch' )
9+ const kleur = require ( 'kleur' )
810
911module . exports = class Core {
1012 constructor ( ) {
@@ -79,19 +81,22 @@ module.exports = class Core {
7981 const matched = matcher ( this . getBranch ( options ) , branches )
8082
8183 matched . forEach ( branch => {
82- const args = options . remotes
84+ const spinner = ora ( `Deleting${ this . text ( branch ) } ` )
85+ spinner . start ( )
86+ const args = this . isRemotes
8387 ? [ 'push' , options . scope , `:${ branch } ` ]
8488 : [ 'branch' , branch , '-D' ]
8589 const ps = spawn . sync ( 'git' , args )
8690 if ( ps . status === 0 ) {
87- logger . success (
88- `Deleted${ options . remotes ? ' remote' : '' } branch` ,
89- `\`${ branch } \``
90- )
91+ spinner . succeed ( `Deleted${ this . text ( branch ) } ` )
9192 }
9293 } )
9394 }
9495
96+ text ( branch ) {
97+ return `${ this . isRemotes ? ' remotes' : '' } branch ` + kleur . magenta ( branch )
98+ }
99+
95100 run ( ) {
96101 this . cli . runMatchedCommand ( )
97102 }
0 commit comments