| 1 | const fs = require('fs'); |
| 2 | |
| 3 | function exists(path, permissions = false, fix = false) |
| 4 | { |
| 5 | if(!fs.existsSync(path)) |
| 6 | throw new Error('Not exists! '+path+(fix ? '\n\nTry: '+fix : '')+'\n'); |
| 7 | |
| 8 | if(permissions !== false) |
| 9 | { |
| 10 | try |
| 11 | { |
| 12 | fs.accessSync(path, permissions); |
| 13 | } |
| 14 | catch (error) |
| 15 | { |
| 16 | throw new Error('No access! '+path+', '+error.message); |
| 17 | } |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | const darwin = './dist/mac/OpenComic.app/Contents/Resources/app.asar.unpacked/node_modules'; |
| 22 | const darwinArm = './dist/mac-arm/OpenComic.app/Contents/Resources/app.asar.unpacked/node_modules'; |