Skip to content

Commit

Permalink
fix: save metadata.json failure
Browse files Browse the repository at this point in the history
Signed-off-by: 张启航 <[email protected]>
  • Loading branch information
ZhangSetSail committed Nov 20, 2024
1 parent 594e260 commit c29d9c7
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion builder/exector/import_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,15 @@ func (i *ImportApp) importApp() error {
i.updateStatusForApp(app, "failed")
return
}
err = storage.Default().StorageCli.UploadFileToFile(path.Join(tmpDir, "metadatas.json"), path.Join(tmpDir, "metadatas.json"), nil)

files, _ := ioutil.ReadDir(tmpDir)
if len(files) < 1 {
logrus.Errorf("Failed to readDir %s: %v", appFile, err)
i.updateStatusForApp(app, "failed")
return
}
metadataJsonPath := path.Join(tmpDir, files[0].Name(), "metadata.json")
err = storage.Default().StorageCli.UploadFileToFile(metadataJsonPath, metadataJsonPath, nil)
if err != nil {
logrus.Errorf("Failed to upload app %s metadatas.json: %v", appFile, err)
i.updateStatusForApp(app, "failed")
Expand Down

0 comments on commit c29d9c7

Please sign in to comment.