Skip to content

Commit

Permalink
bug: skip static files that already exist rather than returning an error
Browse files Browse the repository at this point in the history
  • Loading branch information
austinvalle committed Nov 18, 2024
1 parent 5fd495f commit 112ac30
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/provider/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package provider

import (
"errors"
"fmt"
"io"
"log"
Expand Down Expand Up @@ -45,6 +46,10 @@ func copyFile(srcPath, dstPath string, mode os.FileMode) error {
// If the destination file already exists, we shouldn't blow it away
dstFile, err := os.OpenFile(dstPath, os.O_WRONLY|os.O_CREATE|os.O_EXCL, mode)
if err != nil {
// If the file already exists, we can skip it without returning an error.
if errors.Is(err, os.ErrExist) {
return nil
}
return err
}
defer dstFile.Close()
Expand Down

0 comments on commit 112ac30

Please sign in to comment.