Fixed #580: cross-device error handling failed on Windows
diff --git a/repo/installer.go b/repo/installer.go index 324e4eb..52dcf12 100644 --- a/repo/installer.go +++ b/repo/installer.go
@@ -5,6 +5,7 @@ "io/ioutil" "os" "path/filepath" + "runtime" "strings" "sync" "time" @@ -360,8 +361,11 @@ err = os.Rename(vp, i.VendorPath()) // When there are different physical devices we cannot rename cross device. - // Fall back to manual copy. - if err != nil && strings.Contains(err.Error(), "cross-device link") { + // Note, windows does not return the cross-device link message but instead + // bubbles up a system message (I believe is i18n). So, we try to detect the + // cross device link error or a windows error. If copy fails that will bubble + // up an additional error. + if err != nil && (strings.Contains(err.Error(), "cross-device link") || runtime.GOOS == "windows") { msg.Debug("Cross link err, trying manual copy: %s", err) err = gpath.CopyDir(vp, i.VendorPath())