aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorOlaf Tomalka <olaf@tomalka.me>2018-07-25 06:37:48 +0800
committerOlaf Tomalka <olaf@tomalka.me>2018-07-25 06:37:48 +0800
commitf133aebfaf6259c14f96dcbdbce2d9358fdde562 (patch)
tree897716f33436576cf11425138ba0b41e506440bd /packages
parentfac90c446cc3a79ffe57ae13c685e7555714cf23 (diff)
downloaddexon-sol-tools-f133aebfaf6259c14f96dcbdbce2d9358fdde562.tar
dexon-sol-tools-f133aebfaf6259c14f96dcbdbce2d9358fdde562.tar.gz
dexon-sol-tools-f133aebfaf6259c14f96dcbdbce2d9358fdde562.tar.bz2
dexon-sol-tools-f133aebfaf6259c14f96dcbdbce2d9358fdde562.tar.lz
dexon-sol-tools-f133aebfaf6259c14f96dcbdbce2d9358fdde562.tar.xz
dexon-sol-tools-f133aebfaf6259c14f96dcbdbce2d9358fdde562.tar.zst
dexon-sol-tools-f133aebfaf6259c14f96dcbdbce2d9358fdde562.zip
Fixed the relative resolver not checking if the file can be read in the
first place
Diffstat (limited to 'packages')
-rw-r--r--packages/sol-resolver/src/resolvers/relative_fs_resolver.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/packages/sol-resolver/src/resolvers/relative_fs_resolver.ts b/packages/sol-resolver/src/resolvers/relative_fs_resolver.ts
index 77103b8c1..ed96040d3 100644
--- a/packages/sol-resolver/src/resolvers/relative_fs_resolver.ts
+++ b/packages/sol-resolver/src/resolvers/relative_fs_resolver.ts
@@ -14,7 +14,7 @@ export class RelativeFSResolver extends Resolver {
// tslint:disable-next-line:prefer-function-over-method
public resolveIfExists(importPath: string): ContractSource | undefined {
const filePath = path.join(this._contractsDir, importPath);
- if (fs.existsSync(filePath)) {
+ if (fs.existsSync(filePath) && !fs.lstatSync(filePath).isDirectory()) {
const fileContent = fs.readFileSync(filePath).toString();
return {
source: fileContent,