From f2955ca0a26e56be7534c926ee91c545c69ecfb9 Mon Sep 17 00:00:00 2001 From: luoliwoshang <2643523683@qq.com> Date: Tue, 14 Jan 2025 11:36:53 +0800 Subject: [PATCH] gogensig:prepare deps load --- cmd/gogensig/gogensig.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/cmd/gogensig/gogensig.go b/cmd/gogensig/gogensig.go index cc0a1b8..e44f808 100644 --- a/cmd/gogensig/gogensig.go +++ b/cmd/gogensig/gogensig.go @@ -69,7 +69,7 @@ func main() { wd, err := os.Getwd() check(err) - err = runGoCmds(wd, conf.Name) + err = prepareEnv(wd, conf.Name, conf.Deps) check(err) p, _, err := basic.ConvertProcesser(&basic.Config{ @@ -95,7 +95,7 @@ func check(err error) { } } -func runGoCmds(wd, pkg string) error { +func prepareEnv(wd, pkg string, deps []string) error { dir := filepath.Join(wd, pkg) err := os.MkdirAll(dir, 0744) @@ -113,6 +113,13 @@ func runGoCmds(wd, pkg string) error { return err } + for _, dep := range deps { + err := config.RunCommand(dir, "go", "get", dep) + if err != nil { + return err + } + } + return config.RunCommand(dir, "go", "get", "github.com/goplus/llgo@latest") }