Skip to content

Commit fae07e4

Browse files
authored
Copy package to destination if move failed (should fix sporadic Access is denied errors on Windows) (#1938)
1 parent c9663a3 commit fae07e4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: arduino/resources/install.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,10 @@ func (release *DownloadResource) Install(downloadDir, tempPath, destDir *paths.P
9191

9292
// Move/rename the extracted root directory in the destination directory
9393
if err := root.Rename(destDir); err != nil {
94-
return fmt.Errorf(tr("moving extracted archive to destination dir: %s", err))
94+
// Copy the extracted root directory to the destination directory, if move failed
95+
if err := root.CopyDirTo(destDir); err != nil {
96+
return fmt.Errorf(tr("moving extracted archive to destination dir: %s", err))
97+
}
9598
}
9699

97100
// TODO

0 commit comments

Comments
 (0)