Skip to content

Commit

Permalink
convert/gem/ruby: Don't overwrite existing melange files
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin Vreeland committed Dec 7, 2024
1 parent b5d4d74 commit 98892a3
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pkg/convert/gem/gem.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import (
"fmt"
"io"
"net/http"
"os"
"path/filepath"
"strings"
"time"

Expand Down Expand Up @@ -169,7 +171,13 @@ func (c *GemContext) findDependencies(ctx context.Context) error {
return err
}
log.Infof("[%s] Add to generate list", c.ToCheck[0])
c.ToGenerate[c.ToCheck[0]] = g
// This should be ruby3 once the files are multi-versioned
_, err = os.Stat(filepath.Join(c.OutDir, "ruby3.4-"+g.Name+".yaml"))
if err == nil {
log.Infof("[%s] Package already exists, skipping", g.Name)
} else {
c.ToGenerate[c.ToCheck[0]] = g
}
c.ToCheck = c.ToCheck[1:]

log.Infof("[%s] Check for dependencies", g.Name)
Expand Down

0 comments on commit 98892a3

Please sign in to comment.