mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-18 21:11:19 +02:00
Fix bug on windows where the backslash got removed in func MakePath()
This commit is contained in:
@@ -446,7 +446,14 @@ func GetTempDir(subPath string, fs afero.Fs) string {
|
|||||||
dir = dir + FilePathSeparator
|
dir = dir + FilePathSeparator
|
||||||
}
|
}
|
||||||
if subPath != "" {
|
if subPath != "" {
|
||||||
|
// preserve windows backslash :-(
|
||||||
|
if FilePathSeparator == "\\" {
|
||||||
|
subPath = strings.Replace(subPath, "\\", "____", -1)
|
||||||
|
}
|
||||||
dir = dir + MakePath(subPath)
|
dir = dir + MakePath(subPath)
|
||||||
|
if FilePathSeparator == "\\" {
|
||||||
|
dir = strings.Replace(dir, "____", "\\", -1)
|
||||||
|
}
|
||||||
|
|
||||||
if exists, _ := Exists(dir, fs); exists {
|
if exists, _ := Exists(dir, fs); exists {
|
||||||
return dir
|
return dir
|
||||||
|
Reference in New Issue
Block a user