Skip to content

Commit c79e991

Browse files
committed
fix: merge now keeps source tarball into account
1 parent 72c42fa commit c79e991

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

kaybee/internal/model/statement.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,12 +208,18 @@ func (s *Statement) ToFile(path string) error {
208208

209209
// if the statement has an associated sources tarball,
210210
// then write it to disk, as a sibling to the statement.yaml file
211-
changedSourceCodeTarball := filepath.Join(s.Metadata.LocalPath, "changed-source-code.tar.gz")
211+
212+
changedSourceCodeTarball := filepath.Join(filepath.Dir(s.Metadata.LocalPath), "changed-source-code.tar.gz")
213+
log.Println("Looking for tarball: " + changedSourceCodeTarball)
212214
if _, err := os.Stat(changedSourceCodeTarball); err == nil {
213-
_, err := copyFile(changedSourceCodeTarball, filepath.Join(dest, "changed-source-code.tar.gz"))
215+
_, err := copyFile(changedSourceCodeTarball, filepath.Join(filepath.Dir(dest), "changed-source-code.tar.gz"))
214216
if err != nil {
215-
log.Fatal("Could not copy file " + changedSourceCodeTarball + " to destination: " + dest)
217+
log.Fatal("Could not copy file " + changedSourceCodeTarball + " to destination: " + filepath.Dir(dest))
218+
} else {
219+
log.Println("Tarball copied")
216220
}
221+
} else {
222+
log.Println("No tarball found")
217223
}
218224

219225
return nil

0 commit comments

Comments
 (0)