aboutsummaryrefslogtreecommitdiffstats
path: root/packages/sol-resolver/src
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2018-05-24 00:57:43 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2018-05-24 00:57:43 +0800
commit48e66954470ffb1b547e377d3edbed5d2cf7fc6b (patch)
tree5095d375447e5e61cfbf2e5238025f2ed66fa0f1 /packages/sol-resolver/src
parentebc750d5bf95da76424da81550a88e6b74de8c36 (diff)
downloaddexon-0x-contracts-48e66954470ffb1b547e377d3edbed5d2cf7fc6b.tar.gz
dexon-0x-contracts-48e66954470ffb1b547e377d3edbed5d2cf7fc6b.tar.zst
dexon-0x-contracts-48e66954470ffb1b547e377d3edbed5d2cf7fc6b.zip
Fix NameResolver
Diffstat (limited to 'packages/sol-resolver/src')
-rw-r--r--packages/sol-resolver/src/resolvers/name_resolver.ts10
1 files changed, 6 insertions, 4 deletions
diff --git a/packages/sol-resolver/src/resolvers/name_resolver.ts b/packages/sol-resolver/src/resolvers/name_resolver.ts
index 586fad86a..e489c70a7 100644
--- a/packages/sol-resolver/src/resolvers/name_resolver.ts
+++ b/packages/sol-resolver/src/resolvers/name_resolver.ts
@@ -56,13 +56,15 @@ export class NameResolver extends EnumerableResolver {
throw new Error(`No directory found at ${dirPath}`);
}
for (const fileName of dirContents) {
- if (!fileName.endsWith(SOLIDITY_FILE_EXTENSION)) {
- continue;
- }
const absoluteEntryPath = path.join(dirPath, fileName);
const isDirectory = fs.lstatSync(absoluteEntryPath).isDirectory();
const entryPath = path.relative(this._contractsDir, absoluteEntryPath);
- const isComplete = isDirectory ? this._traverseContractsDir(absoluteEntryPath, onFile) : onFile(entryPath);
+ let isComplete;
+ if (isDirectory) {
+ isComplete = this._traverseContractsDir(absoluteEntryPath, onFile);
+ } else if (fileName.endsWith(SOLIDITY_FILE_EXTENSION)) {
+ isComplete = onFile(entryPath);
+ }
if (isComplete) {
return isComplete;
}