From 48e66954470ffb1b547e377d3edbed5d2cf7fc6b Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Wed, 23 May 2018 09:57:43 -0700 Subject: Fix NameResolver --- packages/sol-resolver/src/resolvers/name_resolver.ts | 10 ++++++---- 1 file 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; } -- cgit v1.2.3