build: make llgen, cltest, gentests call build.Do
This commit is contained in:
@@ -18,6 +18,9 @@
|
||||
package build
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/goplus/llgo/cmd/internal/base"
|
||||
"github.com/goplus/llgo/internal/build"
|
||||
)
|
||||
@@ -41,5 +44,9 @@ func runCmd(cmd *base.Command, args []string) {
|
||||
conf.OutFile = args[1]
|
||||
args = args[2:]
|
||||
}
|
||||
build.Do(args, conf)
|
||||
_, err := build.Do(args, conf)
|
||||
if err != nil {
|
||||
fmt.Fprintln(os.Stderr, err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,9 @@
|
||||
package install
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/goplus/llgo/cmd/internal/base"
|
||||
"github.com/goplus/llgo/internal/build"
|
||||
)
|
||||
@@ -34,5 +37,9 @@ func init() {
|
||||
|
||||
func runCmd(cmd *base.Command, args []string) {
|
||||
conf := build.NewDefaultConf(build.ModeInstall)
|
||||
build.Do(args, conf)
|
||||
_, err := build.Do(args, conf)
|
||||
if err != nil {
|
||||
fmt.Fprintln(os.Stderr, err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,8 @@ package run
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/goplus/llgo/cmd/internal/base"
|
||||
@@ -63,7 +65,11 @@ func runCmdEx(_ *base.Command, args []string, mode build.Mode) {
|
||||
args, runArgs, err := parseRunArgs(args)
|
||||
check(err)
|
||||
conf.RunArgs = runArgs
|
||||
build.Do(args, conf)
|
||||
_, err = build.Do(args, conf)
|
||||
if err != nil {
|
||||
fmt.Fprintln(os.Stderr, err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
func parseRunArgs(args []string) ([]string, []string, error) {
|
||||
|
||||
Reference in New Issue
Block a user