From e48634ba6a85821f1105ae8bf441e9abf88d74b9 Mon Sep 17 00:00:00 2001 From: relan Date: Mon, 18 Apr 2016 23:07:36 +0300 Subject: [PATCH] download: fetch all suggested APKs This command is mostly useful when user does not have the device at the moment. In this case we cannot make any assumptions about it. --- cmd/fdroidcl/download.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/cmd/fdroidcl/download.go b/cmd/fdroidcl/download.go index ece7c64..91a87a9 100644 --- a/cmd/fdroidcl/download.go +++ b/cmd/fdroidcl/download.go @@ -26,12 +26,14 @@ func runDownload(args []string) { } apps := findApps(args) for _, app := range apps { - apk := app.CurApk() - if apk == nil { - log.Fatalf("No current apk found for %s", app.ID) + apks := app.SuggestedApks() + if len(apks) == 0 { + log.Fatalf("No suggested APKs found for %s", app.ID) + } + for _, apk := range apks { + path := downloadApk(&apk) + fmt.Printf("APK available in %s\n", path) } - path := downloadApk(apk) - fmt.Printf("APK available in %s\n", path) } }