Skip to content

Commit 90ff101

Browse files
committed
Fix run conversion on Windows.
Signed-off-by: David Calavera <[email protected]>
1 parent feae114 commit 90ff101

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

go/porcelain/deploy_windows.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
package porcelain
22

33
import (
4+
"fmt"
45
"os"
56
"strings"
67
)
78

89
func forceSlashSeparators(name string) string {
9-
return strings.Replace(name, os.PathSeparator, "/", -1)
10+
return strings.Replace(name, fmt.Sprintf("%c", os.PathSeparator), "/", -1)
1011
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package porcelain
2+
3+
import "testing"
4+
5+
func TestForceSlashSeparators(t *testing.T) {
6+
out := forceSlashSeparators("foo\\bar\\baz.js")
7+
if out != "foo/bar/baz.js" {
8+
t.Fatalf("expected `foo/bar/baz.js`, got `%s`", out)
9+
}
10+
}

0 commit comments

Comments
 (0)