Skip to content

Commit 86899c7

Browse files
committed
Change spinner into inline points
1 parent 615f139 commit 86899c7

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

main.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ import (
44
"bufio"
55
"flag"
66
"fmt"
7-
"github.com/kardianos/osext"
8-
"github.com/mattn/go-shellwords"
9-
"github.com/tj/go-spin"
107
"io"
118
"io/ioutil"
129
"os"
@@ -16,6 +13,9 @@ import (
1613
"strconv"
1714
"strings"
1815
"time"
16+
17+
"github.com/kardianos/osext"
18+
"github.com/mattn/go-shellwords"
1919
)
2020

2121
var (
@@ -238,6 +238,7 @@ func main_load() {
238238
// Finally flash the sketch
239239

240240
if *bin_file_name == "" {
241+
fmt.Println("SUCCESS: Upload completed")
241242
os.Exit(0)
242243
}
243244

@@ -374,9 +375,6 @@ func launchCommandAndWaitForOutput(command []string, stringToSearch string, prin
374375
stderr, _ := oscmd.StderrPipe()
375376
multi := io.MultiReader(stdout, stderr)
376377

377-
s := spin.New()
378-
s.Set(spin.Spin1)
379-
380378
if print_output && *verbose {
381379
oscmd.Stdout = os.Stdout
382380
oscmd.Stderr = os.Stderr
@@ -386,10 +384,12 @@ func launchCommandAndWaitForOutput(command []string, stringToSearch string, prin
386384
in.Split(bufio.ScanRunes)
387385
found := false
388386
out := ""
387+
lastPrint := time.Now()
389388
for in.Scan() {
390389

391-
if show_spinner {
392-
fmt.Printf("\r %s", s.Next())
390+
if show_spinner && time.Since(lastPrint) > time.Second {
391+
fmt.Printf(". ")
392+
lastPrint = time.Now()
393393
}
394394

395395
out += in.Text()

0 commit comments

Comments
 (0)