()
| 359 | } |
| 360 | |
| 361 | func findLocalPolicyPath() string { |
| 362 | wd, err := os.Getwd() |
| 363 | if err != nil { |
| 364 | return "" |
| 365 | } |
| 366 | path := filepath.Join(wd, "coder_policy.json") |
| 367 | if _, err := os.Stat(path); err == nil { |
| 368 | return path |
| 369 | } |
| 370 | return "" |
| 371 | } |
| 372 | |
| 373 | // matchesWithBoundary checks if fullCommand starts with pattern, applying a |
| 374 | // word-boundary check only when the pattern ends with a word character (letter, |