Skip to content
This repository was archived by the owner on Apr 20, 2021. It is now read-only.

Commit 8d4a670

Browse files
committed
Fixup filenames for windows clients, add partition number to output path
1 parent acbe1bc commit 8d4a670

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

filename.go

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// +build !windows
2+
3+
package main
4+
5+
func fixFilename(name string) string {
6+
return name
7+
}

filename_windows.go

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package main
2+
3+
import (
4+
"strings"
5+
)
6+
7+
func fixFilename(name string) string {
8+
name = strings.Replace(name, ":", "_", -1)
9+
return name
10+
}

main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ func main() {
120120
continue
121121
}
122122

123-
outFile := ouputPath + "/" + orig.Fullname()
123+
outFile := ouputPath + fmt.Sprintf("/%d/", partitionNum) + fixFilename(orig.Fullname())
124124
if err := os.MkdirAll(path.Dir(outFile), 0777); err != nil {
125125
fmt.Printf("ERR: could not create path %s: %s", path.Dir(outFile), err)
126126
return

0 commit comments

Comments
 (0)