MCPcopy
hub / github.com/perkeep/perkeep / checkPerkeepSrcRoot

Function checkPerkeepSrcRoot

dev/devcam/devcam.go:153–173  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

151}
152
153func checkPerkeepSrcRoot() {
154 args := flag.Args()
155 // TODO(mpl): we should probably get rid of that limitation someday.
156 if len(args) > 0 && (args[0] == "review" ||
157 args[0] == "hook" ||
158 args[0] == "fixv") {
159 // exception for devcam review, which does its own check.
160 return
161 }
162 if _, err := os.Stat("make.go"); err != nil {
163 if !os.IsNotExist(err) {
164 log.Fatalf("Could not stat make.go: %v", err)
165 }
166 log.Fatal("./make.go not found; devcam needs to be run from the Perkeep source tree root.")
167 }
168 cwd, err := os.Getwd()
169 if err != nil {
170 log.Fatal(err)
171 }
172 camliSrcRoot = cwd
173}
174
175func repoRoot() (string, error) {
176 dir, err := os.Getwd()

Callers 1

mainFunction · 0.85

Calls 3

FatalMethod · 0.80
StatMethod · 0.65
FatalfMethod · 0.65

Tested by

no test coverage detected