-
-
Notifications
You must be signed in to change notification settings - Fork 210
Closed
Description
the iteration in 'download_latest.go' over --black-list will break when a match is found.
This is false as multiple items should be removed.
While fixing it I changed --black-list to support a list strings delimited with ','
diff --git a/cmd/ipsw/cmd/download_latest.go b/cmd/ipsw/cmd/download_latest.go
index 21c460c..c882b7c 100644
--- a/cmd/ipsw/cmd/download_latest.go
+++ b/cmd/ipsw/cmd/download_latest.go
@@ -74,12 +74,22 @@ var latestCmd = &cobra.Command{
}
if len(doNotDownload) > 0 {
- for i, v := range builds {
- if strings.Contains(v.Identifier, doNotDownload) {
- builds = append(builds[:i], builds[i+1:]...)
- break
+ var validBuilds []api.Build
+ doNot := strings.Split(doNotDownload, ",")
+ for _, v := range builds {
+ valid := true
+
+ for _, doNotDownload = range doNot {
+ if strings.Contains(v.Identifier, doNotDownload) {
+ valid = false
+ break
+ }
+ }
+ if valid {
+ validBuilds = append(validBuilds, v)
}
}
+ builds = validBuilds
}
log.Debug("URLs to Download:")
The following will now work
ipsw download -V latest --yes --black-list AppleTV,iPhone
Metadata
Metadata
Assignees
Labels
No labels