aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2018-07-31 20:49:50 +0800
committerGitHub <noreply@github.com>2018-07-31 20:49:50 +0800
commita658aaaf305e4478b38ef14079f6be37fe79c004 (patch)
tree6bfee5a6a19348e0f2e0ed527e920d3db1d955a8
parent02eb575813564b0586a038cc1229a166cb402146 (diff)
parent37590d5f5eae9eea9802d260c6afede1e8c969ac (diff)
downloaddexon-sol-tools-a658aaaf305e4478b38ef14079f6be37fe79c004.tar
dexon-sol-tools-a658aaaf305e4478b38ef14079f6be37fe79c004.tar.gz
dexon-sol-tools-a658aaaf305e4478b38ef14079f6be37fe79c004.tar.bz2
dexon-sol-tools-a658aaaf305e4478b38ef14079f6be37fe79c004.tar.lz
dexon-sol-tools-a658aaaf305e4478b38ef14079f6be37fe79c004.tar.xz
dexon-sol-tools-a658aaaf305e4478b38ef14079f6be37fe79c004.tar.zst
dexon-sol-tools-a658aaaf305e4478b38ef14079f6be37fe79c004.zip
Merge pull request #909 from joincivil/ritave/resolver-check-dirs
Fixed the relative resolver not checking if the file can be read in the
-rw-r--r--packages/sol-resolver/CHANGELOG.md1
-rw-r--r--packages/sol-resolver/src/resolvers/relative_fs_resolver.ts2
2 files changed, 2 insertions, 1 deletions
diff --git a/packages/sol-resolver/CHANGELOG.md b/packages/sol-resolver/CHANGELOG.md
index 5d2ee154a..8ff6ce6ed 100644
--- a/packages/sol-resolver/CHANGELOG.md
+++ b/packages/sol-resolver/CHANGELOG.md
@@ -5,6 +5,7 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
+
## v1.0.4 - _July 26, 2018_
* Dependencies updated
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,