File returns the name of the index file to use. It is either $CSEARCHINDEX or $HOME/.csearchindex.
()
| 429 | // File returns the name of the index file to use. |
| 430 | // It is either $CSEARCHINDEX or $HOME/.csearchindex. |
| 431 | func File() string { |
| 432 | f := os.Getenv("CSEARCHINDEX") |
| 433 | if f != "" { |
| 434 | return f |
| 435 | } |
| 436 | var home string |
| 437 | home = os.Getenv("HOME") |
| 438 | if runtime.GOOS == "windows" && home == "" { |
| 439 | home = os.Getenv("USERPROFILE") |
| 440 | } |
| 441 | return filepath.Clean(home + "/.csearchindex") |
| 442 | } |