@ffflorian/electron-icon-generator 1.8.0 → 1.9.0

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/dist/index.js +21 -6
  2. package/package.json +2 -4
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
+ import fs from 'node:fs/promises';
2
3
  import path from 'node:path';
3
- import fs from 'fs-extra';
4
4
  import { Jimp } from 'jimp';
5
5
  import icongen from 'icon-gen';
6
6
  // eslint-disable-next-line no-magic-numbers
@@ -19,9 +19,18 @@ export class IconGenerator {
19
19
  }
20
20
  async createPNG(size) {
21
21
  const fileName = size.toString();
22
- await fs.ensureDir(this.options.output);
23
- await fs.ensureDir(this.iconsDir);
24
- await fs.ensureDir(this.PNGoutputDir);
22
+ try {
23
+ await fs.mkdir(this.options.output, { recursive: true });
24
+ }
25
+ catch (_a) { }
26
+ try {
27
+ await fs.mkdir(this.iconsDir, { recursive: true });
28
+ }
29
+ catch (_b) { }
30
+ try {
31
+ await fs.mkdir(this.PNGoutputDir, { recursive: true });
32
+ }
33
+ catch (_c) { }
25
34
  const image = await Jimp.read(this.options.input);
26
35
  const resizeFilePath = path.join(this.PNGoutputDir, fileName);
27
36
  // eslint-disable-next-line id-length
@@ -38,7 +47,10 @@ export class IconGenerator {
38
47
  else {
39
48
  const macIconsDir = path.join(this.iconsDir, 'mac');
40
49
  const winIconsDir = path.join(this.iconsDir, 'win');
41
- await fs.ensureDir(macIconsDir);
50
+ try {
51
+ await fs.mkdir(macIconsDir, { recursive: true });
52
+ }
53
+ catch (_a) { }
42
54
  await icongen.default(this.PNGoutputDir, macIconsDir, {
43
55
  icns: {
44
56
  name: 'icon',
@@ -46,7 +58,10 @@ export class IconGenerator {
46
58
  },
47
59
  report: !this.options.silent,
48
60
  });
49
- await fs.ensureDir(winIconsDir);
61
+ try {
62
+ await fs.mkdir(winIconsDir, { recursive: true });
63
+ }
64
+ catch (_b) { }
50
65
  await icongen.default(this.PNGoutputDir, winIconsDir, {
51
66
  icns: {
52
67
  name: 'icon',
package/package.json CHANGED
@@ -3,13 +3,11 @@
3
3
  "bin": "dist/index.js",
4
4
  "dependencies": {
5
5
  "commander": "14.0.2",
6
- "fs-extra": "11.3.2",
7
6
  "icon-gen": "5.0.0",
8
7
  "jimp": "1.6.0"
9
8
  },
10
9
  "description": "An icon generator to generate all the icon files needed for electron packaging",
11
10
  "devDependencies": {
12
- "@types/fs-extra": "11.0.4",
13
11
  "@types/pngjs": "6.0.5",
14
12
  "rimraf": "6.1.0",
15
13
  "tsx": "4.20.6",
@@ -41,6 +39,6 @@
41
39
  "test": "exit 0"
42
40
  },
43
41
  "type": "module",
44
- "version": "1.8.0",
45
- "gitHead": "710af5a32b89acf0765daa81ced41e5031f67116"
42
+ "version": "1.9.0",
43
+ "gitHead": "7af92a4eda3264ed76c22915d30080c4f12dbf55"
46
44
  }