Exclude dotfiles by default, add --include-dotfiles flag

Changed the default behavior to exclude dotfiles (files/dirs starting with .)
which is the more common use case. Added --include-dotfiles flag for when
hidden files need to be included in the manifest.
This commit is contained in:
2025-12-17 15:10:22 -08:00
parent 6dc496fa9e
commit 0e86562c09
9 changed files with 52 additions and 26 deletions

View File

@@ -41,8 +41,8 @@ func (m *manifest) String() string {
// ManifestScanOptions configures behavior when scanning directories for manifest generation.
type ManifestScanOptions struct {
IgnoreDotfiles bool // Skip files and directories starting with a dot
FollowSymLinks bool // Resolve symlinks instead of skipping them
IncludeDotfiles bool // Include files and directories starting with a dot (default: exclude)
FollowSymLinks bool // Resolve symlinks instead of skipping them
}
func (m *manifest) HasError() bool {
@@ -153,7 +153,7 @@ func pathIsHidden(p string) bool {
}
func (m *manifest) addFile(p string, fi fs.FileInfo, sfsIndex int) error {
if m.scanOptions.IgnoreDotfiles && pathIsHidden(p) {
if !m.scanOptions.IncludeDotfiles && pathIsHidden(p) {
return nil
}
if fi != nil && fi.IsDir() {