summaryrefslogtreecommitdiffstats
path: root/helpers/path.go
diff options
context:
space:
mode:
authorCyrill Schumacher <cyrill@schumacher.fm>2014-12-28 10:10:58 +1100
committerspf13 <steve.francia@gmail.com>2015-02-17 12:14:39 -0500
commit41a516819846b98e3b3d13d03815d6d325fbc1e5 (patch)
treee6d84e0d59b175bf2464c65b8bdb3e1e48737c29 /helpers/path.go
parent5e2d3d2e10a4cf1935c2226b023bde2f3ce9e7c0 (diff)
Fix bug on windows where the backslash got removed in func MakePath()
Diffstat (limited to 'helpers/path.go')
-rw-r--r--helpers/path.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/helpers/path.go b/helpers/path.go
index f6c77f9c3..884d807cb 100644
--- a/helpers/path.go
+++ b/helpers/path.go
@@ -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