Skip to content

Commit

Permalink
fix: notui
Browse files Browse the repository at this point in the history
  • Loading branch information
fumiama committed Apr 20, 2024
1 parent f79b3a3 commit 77dc207
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"
"os"
"runtime"
"sync"
"time"

"github.com/fumiama/terasu/dns"
Expand Down Expand Up @@ -57,7 +58,10 @@ func main() {
}
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
wg := sync.WaitGroup{}
wg.Add(1)
go func() {
defer wg.Done()
if *dnsf != "" {
f, err := os.Open(*dnsf)
if err != nil {
Expand Down Expand Up @@ -99,5 +103,9 @@ func main() {
logrus.Warnln("download canceled")
}
}()
sc.show(time.Second)
if notui {
wg.Wait()
} else {
sc.show(time.Second)
}
}

0 comments on commit 77dc207

Please sign in to comment.