Skip to content

Commit 925dce1

Browse files
authored
Merge pull request #136 from go-flutter-desktop/fix/engine-file-exists
Fix engine file exists
2 parents d1fa43c + edcad58 commit 925dce1

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

cmd/build.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,13 @@ func buildGoBinary(targetOS string, vmArguments []string) {
351351
fileutils.CopyDir(build.IntermediatesDirectoryPath(targetOS), build.OutputDirectoryPath(targetOS))
352352

353353
outputEngineFile := filepath.Join(build.OutputDirectoryPath(targetOS), build.EngineFilename(targetOS))
354+
if _, err := os.Stat(outputEngineFile); err == nil || os.IsExist(err) {
355+
err = os.RemoveAll(outputEngineFile)
356+
if err != nil {
357+
log.Errorf("Failed to remove old engine: %v", err)
358+
os.Exit(1)
359+
}
360+
}
354361
err := copy.Copy(
355362
filepath.Join(engineCachePath, build.EngineFilename(targetOS)),
356363
outputEngineFile,

0 commit comments

Comments
 (0)