CustomDir returns the absolute path of the custom directory that contains local overrides. It reads the value of environment variable GOGS_CUSTOM. When not set, it uses the work directory returned by WorkDir function.
()
| 74 | // It reads the value of environment variable GOGS_CUSTOM. When not set, it uses the work |
| 75 | // directory returned by WorkDir function. |
| 76 | func CustomDir() string { |
| 77 | customDirOnce.Do(func() { |
| 78 | customDir = os.Getenv("GOGS_CUSTOM") |
| 79 | if customDir != "" { |
| 80 | return |
| 81 | } |
| 82 | |
| 83 | customDir = filepath.Join(WorkDir(), "custom") |
| 84 | }) |
| 85 | |
| 86 | return customDir |
| 87 | } |
| 88 | |
| 89 | var ( |
| 90 | homeDir string |