Skip to content

Commit

Permalink
change llcppg.symb.json and llcppg.cfg paths to abs path
Browse files Browse the repository at this point in the history
  • Loading branch information
tsingbx committed Oct 21, 2024
1 parent e03edc5 commit f23aff8
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions chore/gogensig/gogensig.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ func runCommand(dir, cmdName string, args ...string) error {
return execCmd.Run()
}

func runGoCmds(pkg string) {
wd, _ := os.Getwd()
func runGoCmds(wd, pkg string) {
dir := filepath.Join(wd, pkg)
os.MkdirAll(dir, 0744)
os.Chdir(pkg)
Expand Down Expand Up @@ -68,17 +67,22 @@ func main() {
conf, err := config.GetCppgCfgFromPath("./llcppg.cfg")
check(err)

runGoCmds(conf.Name)
wd, err := os.Getwd()
check(err)

runGoCmds(wd, conf.Name)

astConvert, err := convert.NewAstConvert(&convert.AstConvertConfig{
PkgName: conf.Name,
SymbFile: "./llcppg.symb.json",
CfgFile: "./llcppg.cfg",
SymbFile: filepath.Join(wd, "llcppg.symb.json"),
CfgFile: filepath.Join(wd, "llcppg.cfg"),
})
check(err)

p := processor.NewDocFileSetProcessor([]visitor.DocVisitor{astConvert})
inputdata, err := unmarshal.UnmarshalFileSet(data)
check(err)

err = p.ProcessFileSet(inputdata)
check(err)
}
Expand Down

0 comments on commit f23aff8

Please sign in to comment.