Try two modulemd paths before failing

This commit is contained in:
Mustafa Gezen 2021-04-26 12:17:40 +02:00
parent c84bb1d953
commit d2b071e239

View File

@ -239,7 +239,11 @@ func patchModuleYaml(pd *data.ProcessData, md *data.ModeData) {
mdTxtPath := "SOURCES/modulemd.src.txt" mdTxtPath := "SOURCES/modulemd.src.txt"
f, err := md.Worktree.Filesystem.Open(mdTxtPath) f, err := md.Worktree.Filesystem.Open(mdTxtPath)
if err != nil { if err != nil {
log.Fatalf("could not open modulemd file: %v", err) mdTxtPath = "SOURCES/modulemd.txt"
f, err = md.Worktree.Filesystem.Open(mdTxtPath)
if err != nil {
log.Fatalf("could not open modulemd file: %v", err)
}
} }
content, err := ioutil.ReadAll(f) content, err := ioutil.ReadAll(f)