Clean repository ROOT directory name with filepath.Clean (#2846)
For better compatibility with Windows.
This commit is contained in:
parent
d91fe5254d
commit
be523152a8
|
@ -971,9 +971,9 @@ func NewContext() {
|
||||||
RepoRootPath = sec.Key("ROOT").MustString(path.Join(homeDir, "gitea-repositories"))
|
RepoRootPath = sec.Key("ROOT").MustString(path.Join(homeDir, "gitea-repositories"))
|
||||||
forcePathSeparator(RepoRootPath)
|
forcePathSeparator(RepoRootPath)
|
||||||
if !filepath.IsAbs(RepoRootPath) {
|
if !filepath.IsAbs(RepoRootPath) {
|
||||||
RepoRootPath = path.Join(AppWorkPath, RepoRootPath)
|
RepoRootPath = filepath.Join(AppWorkPath, RepoRootPath)
|
||||||
} else {
|
} else {
|
||||||
RepoRootPath = path.Clean(RepoRootPath)
|
RepoRootPath = filepath.Clean(RepoRootPath)
|
||||||
}
|
}
|
||||||
ScriptType = sec.Key("SCRIPT_TYPE").MustString("bash")
|
ScriptType = sec.Key("SCRIPT_TYPE").MustString("bash")
|
||||||
if err = Cfg.Section("repository").MapTo(&Repository); err != nil {
|
if err = Cfg.Section("repository").MapTo(&Repository); err != nil {
|
||||||
|
|
Loading…
Reference in New Issue