Skip to content

Commit

Permalink
Make it work on Linux and Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien Plée committed Mar 6, 2020
1 parent 4836def commit 32b30d5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion all_test.go
Expand Up @@ -105,7 +105,7 @@ func TestCopy(t *testing.T) {
})

When(t, "try to copy a directory with subdirectories to skip", func(t *testing.T) {
err := CopyButSkipSome("testdata/case06", "testdata.copy/case06", []string{"testdata\\case06\\caseFilesToSkip"})
err := CopyButSkipSome("testdata/case06", "testdata.copy/case06", []string{"testdata/case06/caseFilesToSkip"})
Expect(t, err).ToBe(nil)
info, err := os.Stat("./testdata.copy/case06/caseFilesToSkip/README.md")
Expect(t, err).Not().ToBe(nil)
Expand Down
2 changes: 1 addition & 1 deletion copy.go
Expand Up @@ -23,7 +23,7 @@ func Copy(src, dest string) error {
func CopyButSkipSome(src, dest string, toSkip []string) error {
toSkipMap := make(map[string]struct{})
for i := 0; i < len(toSkip); i++ {
toSkipMap[toSkip[i]] = struct{}{}
toSkipMap[filepath.FromSlash(toSkip[i])] = struct{}{}
}

info, err := os.Lstat(src)
Expand Down

0 comments on commit 32b30d5

Please sign in to comment.