genOutDir makes the output directory and returns its absolute path
(odir string)
| 38 | |
| 39 | // genOutDir makes the output directory and returns its absolute path |
| 40 | func 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 |
no outgoing calls
no test coverage detected