mirror of
https://github.com/gen2brain/cbconvert
synced 2025-10-13 18:18:52 +02:00
Ignore macOS files, issue #37
This commit is contained in:
@@ -11,6 +11,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
"strings"
|
||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
|
|
||||||
"github.com/gen2brain/avif"
|
"github.com/gen2brain/avif"
|
||||||
@@ -166,9 +167,15 @@ func (c *Converter) convertArchive(ctx context.Context, fileName string) error {
|
|||||||
return c.imageConvert(ctx, img, 0, pathName)
|
return c.imageConvert(ctx, img, 0, pathName)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
} else if !c.Opts.NoNonImage {
|
} else {
|
||||||
if err = copyFile(bytes.NewReader(data), filepath.Join(c.Workdir, filepath.Base(pathName))); err != nil {
|
if filepath.Ext(pathName) == ".DS_Store" || strings.Contains(pathName, "__MACOSX") {
|
||||||
return fmt.Errorf("convertArchive: %w", err)
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if !c.Opts.NoNonImage {
|
||||||
|
if err = copyFile(bytes.NewReader(data), filepath.Join(c.Workdir, filepath.Base(pathName))); err != nil {
|
||||||
|
return fmt.Errorf("convertArchive: %w", err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user