Skip to content

Commit

Permalink
gogensig:prepare deps load
Browse files Browse the repository at this point in the history
  • Loading branch information
luoliwoshang committed Jan 14, 2025
1 parent 56f801c commit f2955ca
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions cmd/gogensig/gogensig.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand All @@ -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)
Expand All @@ -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")
}

Expand Down

0 comments on commit f2955ca

Please sign in to comment.