summaryrefslogtreecommitdiff
path: root/fs/exists.ts
diff options
context:
space:
mode:
authorAxetroy <troy450409405@gmail.com>2019-03-19 00:34:54 +0800
committerRyan Dahl <ry@tinyclouds.org>2019-03-18 12:34:54 -0400
commite12d5521bf80396d0782f9ad3f1d162a88adadaa (patch)
tree69bb94a32f9499ed66d4c725a44edb47045198c7 /fs/exists.ts
parent2e1ed890b85d4ecf1a6332cf2e0c121d5640b496 (diff)
fix: fs.exists not work for symlink (denoland/deno_std#291)
Original: https://github.com/denoland/deno_std/commit/264a51c093e00f3538f735ce8f0c25d20471a33d
Diffstat (limited to 'fs/exists.ts')
-rw-r--r--fs/exists.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/exists.ts b/fs/exists.ts
index 41961a0f2..ce4b83a4c 100644
--- a/fs/exists.ts
+++ b/fs/exists.ts
@@ -2,7 +2,7 @@
/** Test whether or not the given path exists by checking with the file system */
export async function exists(filePath: string): Promise<boolean> {
- return Deno.stat(filePath)
+ return Deno.lstat(filePath)
.then(() => true)
.catch(() => false);
}
@@ -10,7 +10,7 @@ export async function exists(filePath: string): Promise<boolean> {
/** Test whether or not the given path exists by checking with the file system */
export function existsSync(filePath: string): boolean {
try {
- Deno.statSync(filePath);
+ Deno.lstatSync(filePath);
return true;
} catch {
return false;