Skip to content

Commit

Permalink
chore: avoid copying packages when in single-project
Browse files Browse the repository at this point in the history
  • Loading branch information
M0Rf30 committed Nov 3, 2024
1 parent a25f603 commit 0a0738c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pkg/parser/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package parser
import (
"os"
"path/filepath"
"strings"

"github.com/M0Rf30/yap/pkg/pkgbuild"
"github.com/M0Rf30/yap/pkg/utils"
Expand Down Expand Up @@ -37,6 +38,16 @@ func ParseFile(distro, release, startDir, home string) (*pkgbuild.PKGBUILD, erro
OnSymlink: func(_ string) copy.SymlinkAction {
return copy.Skip
},
Skip: func(_ os.FileInfo, src, _ string) (bool, error) {
if strings.HasSuffix(src, ".apk") ||
strings.HasSuffix(src, ".deb") ||
strings.HasSuffix(src, ".pkg.tar.zst") ||
strings.HasSuffix(src, ".rpm") {
return true, nil
}

return false, nil
},
}

if err != nil {
Expand Down

0 comments on commit 0a0738c

Please sign in to comment.