fix: goctl not compile on windows (#1500)
This commit is contained in:
@@ -10,16 +10,13 @@ import (
|
||||
"io/fs"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"os/signal"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strings"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/logrusorgru/aurora"
|
||||
"github.com/urfave/cli"
|
||||
"github.com/zeromicro/go-zero/core/syncx"
|
||||
"github.com/zeromicro/go-zero/tools/goctl/util/console"
|
||||
"github.com/zeromicro/go-zero/tools/goctl/util/ctx"
|
||||
"github.com/zeromicro/go-zero/tools/goctl/vars"
|
||||
@@ -71,22 +68,7 @@ func rewriteImport(verbose bool) error {
|
||||
time.Sleep(200 * time.Millisecond)
|
||||
}
|
||||
|
||||
doneChan := syncx.NewDoneChan()
|
||||
defer func() {
|
||||
doneChan.Close()
|
||||
}()
|
||||
go func(dc *syncx.DoneChan) {
|
||||
c := make(chan os.Signal)
|
||||
signal.Notify(c, syscall.SIGTERM, syscall.SIGKILL, syscall.SIGINT, syscall.SIGTSTP, syscall.SIGQUIT)
|
||||
select {
|
||||
case <-c:
|
||||
console.Error(`
|
||||
migrate failed, reason: "User Canceled"`)
|
||||
os.Exit(0)
|
||||
case <-dc.Done():
|
||||
return
|
||||
}
|
||||
}(doneChan)
|
||||
cancelOnSignals()
|
||||
|
||||
wd, err := os.Getwd()
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user