mirror of
https://gitee.com/johng/gf.git
synced 2024-12-01 19:57:40 +08:00
improve command gf run
This commit is contained in:
parent
1e141d9f64
commit
119d8bf98c
@ -13,6 +13,7 @@ import (
|
||||
"github.com/gogf/gf/v2/os/gproc"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"github.com/gogf/gf/v2/os/gtimer"
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
"github.com/gogf/gf/v2/util/gtag"
|
||||
)
|
||||
|
||||
@ -149,9 +150,9 @@ func (app *cRunApp) Run() {
|
||||
if runtime.GOOS == "windows" {
|
||||
// Special handling for windows platform.
|
||||
// DO NOT USE "cmd /c" command.
|
||||
process = gproc.NewProcess(runCommand, nil)
|
||||
process = gproc.NewProcess(outputPath, gstr.SplitAndTrim(" ", app.Args))
|
||||
} else {
|
||||
process = gproc.NewProcessCmd(runCommand, nil)
|
||||
process = gproc.NewProcessCmd(outputPath, gstr.SplitAndTrim(" ", app.Args))
|
||||
}
|
||||
if pid, err := process.Start(); err != nil {
|
||||
mlog.Printf("build running error: %s", err.Error())
|
||||
|
@ -38,8 +38,7 @@ func getRegexp(pattern string) (regex *regexp.Regexp, err error) {
|
||||
}
|
||||
// If it does not exist in the cache,
|
||||
// it compiles the pattern and creates one.
|
||||
regex, err = regexp.Compile(pattern)
|
||||
if err != nil {
|
||||
if regex, err = regexp.Compile(pattern); err != nil {
|
||||
err = gerror.Wrapf(err, `regexp.Compile failed for pattern "%s"`, pattern)
|
||||
return
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user