Skip to content

Commit

Permalink
Add spinner for execute
Browse files Browse the repository at this point in the history
  • Loading branch information
rkervella committed Jan 27, 2021
1 parent ee58268 commit 8b24556
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions client/command/execute.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ package command
import (
"context"
"fmt"
"strings"

"github.com/bishopfox/sliver/client/spin"
"github.com/bishopfox/sliver/protobuf/rpcpb"
"github.com/bishopfox/sliver/protobuf/sliverpb"
"github.com/desertbit/grumble"
Expand All @@ -41,12 +43,17 @@ func execute(ctx *grumble.Context, rpc rpcpb.SliverRPCClient) {
args = ctx.Args[1:]
}
output := ctx.Flags.Bool("silent")
ctrl := make(chan bool)
msg := fmt.Sprintf("Executing %s %s...", cmdPath, strings.Join(args, " "))
go spin.Until(msg, ctrl)
exec, err := rpc.Execute(context.Background(), &sliverpb.ExecuteReq{
Request: ActiveSession.Request(ctx),
Path: cmdPath,
Args: args,
Output: !output,
})
ctrl <- true
<-ctrl
if err != nil {
fmt.Printf(Warn+"%s", err)
} else if !output {
Expand Down

0 comments on commit 8b24556

Please sign in to comment.