publish: check if storage exists

This commit is contained in:
André Roth
2026-06-18 13:36:17 +02:00
parent 29e643cdf6
commit dd85493b1a
14 changed files with 94 additions and 70 deletions
+5 -3
View File
@@ -198,9 +198,11 @@ func aptlyPublishSnapshotOrRepo(cmd *commander.Command, args []string) error {
context.Progress().Printf("\n%s been successfully published.\n", message)
if localStorage, ok := context.GetPublishedStorage(storage).(aptly.FileSystemPublishedStorage); ok {
context.Progress().Printf("Please setup your webserver to serve directory '%s' with autoindexing.\n",
localStorage.PublicPath())
if ps, err := context.GetPublishedStorage(storage); err == nil {
if localStorage, ok := ps.(aptly.FileSystemPublishedStorage); ok {
context.Progress().Printf("Please setup your webserver to serve directory '%s' with autoindexing.\n",
localStorage.PublicPath())
}
}
context.Progress().Printf("Now you can add following line to apt sources:\n")
+5 -1
View File
@@ -97,7 +97,11 @@ func aptlyServe(cmd *commander.Command, args []string) error {
}
}
publicPath := context.GetPublishedStorage("").(aptly.FileSystemPublishedStorage).PublicPath()
ps, err := context.GetPublishedStorage("")
if err != nil {
return err
}
publicPath := ps.(aptly.FileSystemPublishedStorage).PublicPath()
ShutdownContext()
fmt.Printf("\nStarting web server at: %s (press Ctrl+C to quit)...\n", listen)