MCPcopy Create free account
hub / github.com/gogs/gogs / CustomDir

Function CustomDir

internal/conf/computed.go:76–87  ·  view source on GitHub ↗

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.

()

Source from the content-addressed store, hash-verified

74// It reads the value of environment variable GOGS_CUSTOM. When not set, it uses the work
75// directory returned by WorkDir function.
76func 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
89var (
90 homeDir string

Callers 13

renderFunction · 0.92
NewConnectionFunction · 0.92
LoadRepoConfigFunction · 0.92
getRepoInitFileFunction · 0.92
renderNoticeBannerMethod · 0.92
addCustomDirToBackupFunction · 0.92
newMacaronFunction · 0.92
runWebFunction · 0.92
runRestoreFunction · 0.92
GlobalInitFunction · 0.92
TestCustomDirHelperFunction · 0.85
TestCustomDirFunction · 0.85

Calls 1

WorkDirFunction · 0.85

Tested by 2

TestCustomDirHelperFunction · 0.68
TestCustomDirFunction · 0.68