Skip to content

Commit

Permalink
Update pkg.go
Browse files Browse the repository at this point in the history
  • Loading branch information
blacktop committed Feb 9, 2025
1 parent 5ac92e9 commit 0f62101
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmd/ipsw/cmd/pkg.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ var pkgCmd = &cobra.Command{
log.Warn("PKG/XAR file signature is invalid, this may be a corrupted file")
}
if pattern != "" {
found := false
re, err := regexp.Compile(pattern)
if err != nil {
return fmt.Errorf("invalid regex pattern: '%s'", pattern)
Expand All @@ -144,6 +145,7 @@ var pkgCmd = &cobra.Command{
payload = file
}
if re.MatchString(file.Name) {
found = true
fname := filepath.Join(output, file.Name)
if flat {
fname = filepath.Join(output, filepath.Base(file.Name))
Expand Down Expand Up @@ -186,6 +188,7 @@ var pkgCmd = &cobra.Command{
}
for _, file := range cr.Files {
if re.MatchString(file.Name) {
found = true
fname := filepath.Join(output, file.Name)
if flat {
fname = filepath.Join(output, filepath.Base(file.Name))
Expand All @@ -211,6 +214,9 @@ var pkgCmd = &cobra.Command{
}
}
}
if !found {
log.Warnf("No files found that match pattern '%s'", pattern)
}
}
} else {
var names []string
Expand Down

0 comments on commit 0f62101

Please sign in to comment.