Skip to content

Commit

Permalink
WIP: adds logic to rename in noop to delete and retry if file already…
Browse files Browse the repository at this point in the history
… exists so it works on windows)
  • Loading branch information
mavenraven committed Feb 23, 2015
1 parent 1e59e50 commit 73ad497
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
Binary file added .cached_downloader.go.swp
Binary file not shown.
10 changes: 10 additions & 0 deletions cached_downloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ type CachedDownloader interface {
func NoopTransform(source, destination string) (int64, error) {
err := os.Rename(source, destination)
if err != nil {
if _, ok := err.(*os.LinkError); ok {
err = os.Remove(destination)
if err != nil {
return 0, err
}
err = os.Rename(source, destination)
if err != nil {
return 0, err
}
}
return 0, err
}

Expand Down
Binary file added cacheddownloader.test.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
. "github.com/onsi/gomega"
)

var _ = Describe("Integration", func() {
var _ = FDescribe("Integration", func() {
var (
server *httptest.Server
serverPath string
Expand Down

0 comments on commit 73ad497

Please sign in to comment.