(adapted4debian) publish: check if storage exists

This commit is contained in:
André Roth
2026-06-20 11:01:08 +02:00
parent 44d00ca240
commit f47586a19a
10 changed files with 76 additions and 47 deletions
+6 -1
View File
@@ -60,7 +60,12 @@ func reposServeInAPIMode(c *gin.Context) {
storage = "filesystem:" + storage
}
publicPath := context.GetPublishedStorage(storage).(aptly.FileSystemPublishedStorage).PublicPath()
ps, err := context.GetPublishedStorage(storage)
if err != nil {
AbortWithJSONError(c, http.StatusNotFound, err)
return
}
publicPath := ps.(aptly.FileSystemPublishedStorage).PublicPath()
c.FileFromFS(pkgpath, http.Dir(publicPath))
}