Skip to content

Commit

Permalink
fix: merge now keeps source tarball into account
Browse files Browse the repository at this point in the history
  • Loading branch information
copernico committed Nov 3, 2020
1 parent 72c42fa commit c79e991
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions kaybee/internal/model/statement.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,12 +208,18 @@ func (s *Statement) ToFile(path string) error {

// if the statement has an associated sources tarball,
// then write it to disk, as a sibling to the statement.yaml file
changedSourceCodeTarball := filepath.Join(s.Metadata.LocalPath, "changed-source-code.tar.gz")

changedSourceCodeTarball := filepath.Join(filepath.Dir(s.Metadata.LocalPath), "changed-source-code.tar.gz")
log.Println("Looking for tarball: " + changedSourceCodeTarball)
if _, err := os.Stat(changedSourceCodeTarball); err == nil {
_, err := copyFile(changedSourceCodeTarball, filepath.Join(dest, "changed-source-code.tar.gz"))
_, err := copyFile(changedSourceCodeTarball, filepath.Join(filepath.Dir(dest), "changed-source-code.tar.gz"))
if err != nil {
log.Fatal("Could not copy file " + changedSourceCodeTarball + " to destination: " + dest)
log.Fatal("Could not copy file " + changedSourceCodeTarball + " to destination: " + filepath.Dir(dest))
} else {
log.Println("Tarball copied")
}
} else {
log.Println("No tarball found")
}

return nil
Expand Down

0 comments on commit c79e991

Please sign in to comment.