From 342a94d27e4b73e840446859728da0edd26a9d07 Mon Sep 17 00:00:00 2001 From: RangerCD Date: Sat, 22 Oct 2022 13:22:46 +0800 Subject: [PATCH] Copy package to destination if move failed --- arduino/resources/install.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arduino/resources/install.go b/arduino/resources/install.go index 165020250b3..188a8d2f1f5 100644 --- a/arduino/resources/install.go +++ b/arduino/resources/install.go @@ -91,7 +91,10 @@ func (release *DownloadResource) Install(downloadDir, tempPath, destDir *paths.P // Move/rename the extracted root directory in the destination directory if err := root.Rename(destDir); err != nil { - return fmt.Errorf(tr("moving extracted archive to destination dir: %s", err)) + // Copy the extracted root directory to the destination directory, if move failed + if err := root.CopyDirTo(destDir); err != nil { + return fmt.Errorf(tr("moving extracted archive to destination dir: %s", err)) + } } // TODO