| 151 | } |
| 152 | |
| 153 | func 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 | |
| 175 | func repoRoot() (string, error) { |
| 176 | dir, err := os.Getwd() |