aboutsummaryrefslogtreecommitdiffstats
path: root/packages/sol-resolver/src
diff options
context:
space:
mode:
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;
}