mirror of
https://github.com/gohugoio/hugo.git
synced 2025-03-20 10:44:20 +00:00
Fix bug on windows where the backslash got removed in func MakePath()
This commit is contained in:
parent
5e2d3d2e10
commit
41a5168198
1 changed files with 7 additions and 0 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue