[BRANDING] alias {FORGEJO,GITEA}_{CUSTOM,WORK_DIR}
FORGEJO_* environment variables are set to the corresponding GITEA_* variable when the cli starts. This approach is intended to minimize the conflicts on rebase. All occurences of GITEA_* are left untouched in the codebase and they are only changed to FORGEJO_* if exposed to the user. (cherry picked from commite466f9d10e
) (cherry picked from commite33e95931b
) (cherry picked from commit2cfc6519b7
) (cherry picked from commitaf8864373a
) (cherry picked from commita0550ff339
) (cherry picked from commit24dc0a5191
) (cherry picked from commite255eea2b4
) (cherry picked from commit0c4f5afa7a
) (cherry picked from commit42fce708d0
) (cherry picked from commite7278c3c22
) (cherry picked from commit0fb9ed7e0e
) (cherry picked from commita98308aa4d
) (cherry picked from commitb8695fcbe0
) (cherry picked from commit4aee8719f5
) (cherry picked from commit1c503c1ba7
) (cherry picked from commitcf1ed8551e
) (cherry picked from commitc52459b088
) (cherry picked from commit92cac277b2
) (cherry picked from commit2c744f1118
) (cherry picked from commit989a98a8c5
) (cherry picked from commit9cf7052bd4
) (cherry picked from commita13c9667e0
) Conflicts: main.go https://codeberg.org/forgejo/forgejo/pulls/1216 (cherry picked from commita9c3cf060d
) (cherry picked from commiteb6d904b23
) (cherry picked from commitfd4878e487
) (cherry picked from commitcc2cab9241
)
This commit is contained in:
parent
8968f34edf
commit
be523c63db
4 changed files with 121 additions and 4 deletions
|
@ -129,6 +129,14 @@ func InitWorkPathAndCfgProvider(getEnvFn func(name string) string, args ArgWorkP
|
|||
}
|
||||
}
|
||||
|
||||
envWorkPath = getEnvFn("FORGEJO_WORK_DIR")
|
||||
if envWorkPath != "" {
|
||||
tmpWorkPath.Set(envWorkPath)
|
||||
if !filepath.IsAbs(tmpWorkPath.Value) {
|
||||
log.Fatal("FORGEJO_WORK_DIR (work path) must be absolute path")
|
||||
}
|
||||
}
|
||||
|
||||
envCustomPath := getEnvFn("GITEA_CUSTOM")
|
||||
if envCustomPath != "" {
|
||||
tmpCustomPath.Set(envCustomPath)
|
||||
|
@ -136,6 +144,14 @@ func InitWorkPathAndCfgProvider(getEnvFn func(name string) string, args ArgWorkP
|
|||
log.Fatal("GITEA_CUSTOM (custom path) must be absolute path")
|
||||
}
|
||||
}
|
||||
|
||||
envCustomPath = getEnvFn("FORGEJO_CUSTOM")
|
||||
if envCustomPath != "" {
|
||||
tmpCustomPath.Set(envCustomPath)
|
||||
if !filepath.IsAbs(tmpCustomPath.Value) {
|
||||
log.Fatal("FORGEJO_CUSTOM (custom path) must be absolute path")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
readFromArgs := func() {
|
||||
|
@ -180,7 +196,7 @@ func InitWorkPathAndCfgProvider(getEnvFn func(name string) string, args ArgWorkP
|
|||
log.Fatal("WORK_PATH in %q must be absolute path", configWorkPath)
|
||||
}
|
||||
configWorkPath = filepath.Clean(configWorkPath)
|
||||
if tmpWorkPath.Value != "" && (getEnvFn("GITEA_WORK_DIR") != "" || args.WorkPath != "") {
|
||||
if tmpWorkPath.Value != "" && (getEnvFn("GITEA_WORK_DIR") != "" || getEnvFn("FORGEJO_WORK_DIR") != "" || args.WorkPath != "") {
|
||||
fi1, err1 := os.Stat(tmpWorkPath.Value)
|
||||
fi2, err2 := os.Stat(configWorkPath)
|
||||
if err1 != nil || err2 != nil || !os.SameFile(fi1, fi2) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue