Skip to content
This repository has been archived by the owner on Jun 16, 2022. It is now read-only.

Fix backslashes in URLs on Windows #100

Merged
merged 1 commit into from
Mar 30, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tasks/bintray.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ func walkFunc(fullPath string, fi2 os.FileInfo, err error, reportFilename string
versionDir := filepath.Join(tp.OutDestRoot, tp.Settings.GetFullVersionName())

relativePath := strings.Replace(fullPath, versionDir, "", -1)
relativePath = strings.Replace(relativePath, "\\", "/", -1)
relativePath = strings.TrimPrefix(relativePath, "/")
fmt.Printf("relative path %s, full path %s\n", relativePath, fullPath)

Expand Down
1 change: 1 addition & 0 deletions tasks/downloads-page.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ func downloadsWalkFunc(fullPath string, Version string, fi2 os.FileInfo, err err

versionDir := filepath.Join(tp.OutDestRoot, tp.Settings.GetFullVersionName())
relativePath := strings.Replace(fullPath, versionDir, "", -1)
relativePath = strings.Replace(relativePath, "\\", "/", -1)
relativePath = strings.TrimPrefix(relativePath, "/")
text := fi2.Name()
if format == "markdown" {
Expand Down
1 change: 1 addition & 0 deletions tasks/github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ func ghWalkFunc(fullPath string, fi2 os.FileInfo, err error, reportFilename stri
excludeGlobs := core.ParseCommaGlobs(excludeResources)
versionDir := filepath.Join(tp.OutDestRoot, tp.Settings.GetFullVersionName())
relativePath := strings.Replace(fullPath, versionDir, "", -1)
relativePath = strings.Replace(relativePath, "\\", "/", -1)
relativePath = strings.TrimPrefix(relativePath, "/")
//fmt.Printf("relative path %s, full path %s\n", relativePath, fullPath)
if fi2.IsDir() {
Expand Down
4 changes: 3 additions & 1 deletion tasks/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ func httpWalk(config *httpTaskConfig, fullPath string, fi os.FileInfo, err error
return nil
}
versionDir := filepath.Join(tp.OutDestRoot, tp.Settings.GetFullVersionName())
relativePath := strings.TrimPrefix(strings.Replace(fullPath, versionDir, "", -1), "/")
relativePath := strings.Replace(fullPath, versionDir, "", -1)
relativePath = strings.Replace(relativePath, "\\", "/", -1)
relativePath = strings.TrimPrefix(relativePath, "/")
if !tp.Settings.IsQuiet() {
log.Printf("Considering %s", relativePath)
}
Expand Down