Skip to content

Commit

Permalink
add go mod command to resolve dependencies in the generated project
Browse files Browse the repository at this point in the history
  • Loading branch information
1414C committed Mar 27, 2024
1 parent 72ef6f8 commit 6ac8e7b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"io/ioutil"
"log"
"os"
"os/exec"
"strings"

"github.com/1414C/jiffy/gen"
Expand Down Expand Up @@ -365,4 +366,15 @@ func main() {
log.Fatal(err)
}
}

// run go mod tidy against the generated app
err = os.Chdir(*projectPath)
if err != nil {
log.Fatal(err)
}
cmd2 := exec.Command("go", "mod", "tidy")
err = cmd2.Run()
if err != nil {
log.Fatal(err)
}
}

0 comments on commit 6ac8e7b

Please sign in to comment.