diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-05-15 00:34:04 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-05-23 06:20:33 +0800 |
commit | 842f2ea5cc75c66397597a21202f4b8cf3082ed6 (patch) | |
tree | a5ba6790bd00e9bed5fce9ef1f8fd2f75e072ec6 | |
parent | ae220c37dff04c8d4d22e48865a5a268000c2f12 (diff) | |
download | dexon-sol-tools-842f2ea5cc75c66397597a21202f4b8cf3082ed6.tar dexon-sol-tools-842f2ea5cc75c66397597a21202f4b8cf3082ed6.tar.gz dexon-sol-tools-842f2ea5cc75c66397597a21202f4b8cf3082ed6.tar.bz2 dexon-sol-tools-842f2ea5cc75c66397597a21202f4b8cf3082ed6.tar.lz dexon-sol-tools-842f2ea5cc75c66397597a21202f4b8cf3082ed6.tar.xz dexon-sol-tools-842f2ea5cc75c66397597a21202f4b8cf3082ed6.tar.zst dexon-sol-tools-842f2ea5cc75c66397597a21202f4b8cf3082ed6.zip |
Fix a bug in FS resolver causing it to try reading directories
-rw-r--r-- | packages/sol-resolver/src/resolvers/fs_resolver.ts | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/packages/sol-resolver/src/resolvers/fs_resolver.ts b/packages/sol-resolver/src/resolvers/fs_resolver.ts index 4f05fba88..63fc3448e 100644 --- a/packages/sol-resolver/src/resolvers/fs_resolver.ts +++ b/packages/sol-resolver/src/resolvers/fs_resolver.ts @@ -7,7 +7,7 @@ import { Resolver } from './resolver'; export class FSResolver extends Resolver { // tslint:disable-next-line:prefer-function-over-method public resolveIfExists(importPath: string): ContractSource | undefined { - if (fs.existsSync(importPath)) { + if (fs.existsSync(importPath) && fs.lstatSync(importPath).isFile()) { const fileContent = fs.readFileSync(importPath).toString(); return { source: fileContent, |