MCPcopy
hub / github.com/ollm/OpenComic / exists

Function exists

scripts/test-postbuild.js:3–19  ·  view source on GitHub ↗
(path, permissions = false, fix = false)

Source from the content-addressed store, hash-verified

1const fs = require('fs');
2
3function 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
21const darwin = './dist/mac/OpenComic.app/Contents/Resources/app.asar.unpacked/node_modules';
22const darwinArm = './dist/mac-arm/OpenComic.app/Contents/Resources/app.asar.unpacked/node_modules';

Callers 1

test-postbuild.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected