Skip to content

Commit 3527c72

Browse files
committed
improved file exist checking
1 parent 86cc213 commit 3527c72

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/tools/file.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
var fs = require('fs');
33
function fileExists(path) {
44
try {
5-
fs.accessSync(path, fs.R_OK | fs.W_OK);
5+
fs.accessSync(path, fs.F_OK);
66
}
77
catch (e) {
88
if (e) {

src/tools/file.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as fs from 'fs';
22

33
export function fileExists(path: string): boolean {
44
try {
5-
fs.accessSync(path, fs.R_OK | fs.W_OK);
5+
fs.accessSync(path, fs.F_OK);
66
} catch (e) {
77
if (e) {
88
if (e.code !== 'ENOENT') {

0 commit comments

Comments
 (0)