auto-image-converter 1.0.15 → 1.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/converter.js +5 -1
  2. package/package.json +1 -1
package/lib/converter.js CHANGED
@@ -2,6 +2,7 @@ import fg from "fast-glob";
2
2
  import sharp from "sharp";
3
3
  import fs from "node:fs/promises";
4
4
  import path from "node:path";
5
+ import { convertPathToPosix } from "fast-glob/out/utils/path";
5
6
 
6
7
  const supportedExt = [".png", ".jpg", ".jpeg"];
7
8
 
@@ -12,9 +13,12 @@ export async function convertImages({
12
13
  recursive,
13
14
  removeOriginal,
14
15
  }) {
15
- const pattern = recursive
16
+ const rawPattern = recursive
16
17
  ? path.join(dir, "**", "*.{png,jpg,jpeg}")
17
18
  : path.join(dir, "*.{png,jpg,jpeg}");
19
+
20
+ // Преобразуем \ → /
21
+ const pattern = rawPattern.convertPathToPosix(rawPattern);
18
22
  console.log("Ищу файлы по пути:", pattern);
19
23
  const files = await fg(pattern, { caseSensitiveMatch: false });
20
24
  console.log("Текущая директория:", process.cwd());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "auto-image-converter",
3
- "version": "1.0.15",
3
+ "version": "1.0.16",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "auto-convert-images": "./bin/index.js"