generated from Seekra/repository-template
feat(build): make permissions checks less strict
This commit is contained in:
@@ -16,16 +16,6 @@ limitations under the License.
|
||||
|
||||
import { access, constants, stat } from 'node:fs/promises';
|
||||
|
||||
export const checkFileReadAccess = async function checkFileWriteAccess (path) {
|
||||
try {
|
||||
await access(path, constants.F_OK | constants.R_OK);
|
||||
return true;
|
||||
} catch (err) {
|
||||
if (err.code === 'ENOENT' || err.code === 'EACCES') return false;
|
||||
else throw err;
|
||||
}
|
||||
};
|
||||
|
||||
export const exists = async function exists (path) {
|
||||
try {
|
||||
await access(path, constants.F_OK);
|
||||
|
||||
Reference in New Issue
Block a user