more appropriate function name
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
375e468a8e
commit
b6e03db1ea
@ -37,7 +37,7 @@ func moveBuildArtifacts() bool {
|
|||||||
newROMs = true
|
newROMs = true
|
||||||
log.Printf("new build found - moving file %s", v.Name())
|
log.Printf("new build found - moving file %s", v.Name())
|
||||||
romCache.Lock() // lock to prevent multiple concurrent goroutines moving the same file
|
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()
|
romCache.Unlock()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("failed to move file '%s' from out to rom directory: %v", v.Name(), err)
|
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
|
// 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
|
// 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)
|
sourceFileStat, err := os.Stat(src)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
Loading…
Reference in New Issue
Block a user