MCPcopy Index your code
hub / github.com/go-python/gopy / genOutDir

Function genOutDir

gen.go:40–59  ·  view source on GitHub ↗

genOutDir makes the output directory and returns its absolute path

(odir string)

Source from the content-addressed store, hash-verified

38
39// genOutDir makes the output directory and returns its absolute path
40func genOutDir(odir string) (string, error) {
41 cwd, err := os.Getwd()
42 if err != nil {
43 log.Fatal(err)
44 }
45
46 if odir == "" {
47 odir = cwd
48 } else {
49 err = os.MkdirAll(odir, 0755)
50 if err != nil {
51 return odir, fmt.Errorf("gopy-gen: could not create output directory: %v", err)
52 }
53 }
54 odir, err = filepath.Abs(odir)
55 if err != nil {
56 return odir, fmt.Errorf("gopy-gen: could not infer absolute path to output directory: %v", err)
57 }
58 return odir, nil
59}
60
61// genPkg generates output for all the current packages that have been parsed,
62// in the given output directory

Callers 4

gopyRunCmdPkgFunction · 0.85
runBuildFunction · 0.85
genPkgFunction · 0.85
gopyRunCmdExeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected