diff --git a/processFiles.go b/processFiles.go index a7b8944..7be5f7c 100644 --- a/processFiles.go +++ b/processFiles.go @@ -37,7 +37,7 @@ func moveBuildArtifacts() bool { newROMs = true log.Printf("new build found - moving file %s", v.Name()) romCache.Lock() // lock to prevent multiple concurrent goroutines moving the same file - err := moveBuildFile(fmt.Sprintf("%s/%s", buildOutDirectory, v.Name()), fmt.Sprintf("%s/%s", romDirectory, v.Name())) + err := copyThenDeleteFile(fmt.Sprintf("%s/%s", buildOutDirectory, v.Name()), fmt.Sprintf("%s/%s", romDirectory, v.Name())) romCache.Unlock() if err != nil { log.Printf("failed to move file '%s' from out to rom directory: %v", v.Name(), err) @@ -82,7 +82,7 @@ func isLineageROMZip(v fs.DirEntry) (bool, []string) { // A custom "move file" function because in docker container the mounted folders are different overlay filesystems // Instead of os.Rename, we must copy and delete -func moveBuildFile(src, dst string) error { +func copyThenDeleteFile(src, dst string) error { sourceFileStat, err := os.Stat(src) if err != nil { return err