mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05: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
|
||||
}
|
||||
if subPath != "" {
|
||||
// preserve windows backslash :-(
|
||||
if FilePathSeparator == "\\" {
|
||||
subPath = strings.Replace(subPath, "\\", "____", -1)
|
||||
}
|
||||
dir = dir + MakePath(subPath)
|
||||
if FilePathSeparator == "\\" {
|
||||
dir = strings.Replace(dir, "____", "\\", -1)
|
||||
}
|
||||
|
||||
if exists, _ := Exists(dir, fs); exists {
|
||||
return dir
|
||||
|
|
Loading…
Reference in a new issue