diff options
Diffstat (limited to 'packages/sol-resolver')
-rw-r--r-- | packages/sol-resolver/CHANGELOG.json | 13 | ||||
-rw-r--r-- | packages/sol-resolver/package.json | 4 | ||||
-rw-r--r-- | packages/sol-resolver/src/resolvers/npm_resolver.ts | 2 | ||||
-rw-r--r-- | packages/sol-resolver/src/resolvers/relative_fs_resolver.ts | 2 |
4 files changed, 17 insertions, 4 deletions
diff --git a/packages/sol-resolver/CHANGELOG.json b/packages/sol-resolver/CHANGELOG.json index 114cf2ce6..dd9cb3f5d 100644 --- a/packages/sol-resolver/CHANGELOG.json +++ b/packages/sol-resolver/CHANGELOG.json @@ -1,5 +1,18 @@ [ { + "version": "1.0.5", + "changes": [ + { + "note": "Fix a bug where RelativeFSResolver would crash when trying to read a directory", + "pr": 909 + }, + { + "note": "Fix a bug where NpmResolver would crash when trying to read a directory", + "pr": 961 + } + ] + }, + { "timestamp": 1532619515, "version": "1.0.4", "changes": [ diff --git a/packages/sol-resolver/package.json b/packages/sol-resolver/package.json index dd5915237..4ce33cf59 100644 --- a/packages/sol-resolver/package.json +++ b/packages/sol-resolver/package.json @@ -30,12 +30,12 @@ "make-promises-safe": "^1.1.0", "shx": "^0.2.2", "tslint": "5.11.0", - "typescript": "2.7.1" + "typescript": "2.9.2" }, "dependencies": { "@0xproject/types": "^1.0.1-rc.3", "@0xproject/typescript-typings": "^1.0.3", - "lodash": "^4.17.4" + "lodash": "^4.17.5" }, "publishConfig": { "access": "public" diff --git a/packages/sol-resolver/src/resolvers/npm_resolver.ts b/packages/sol-resolver/src/resolvers/npm_resolver.ts index 9f8617145..a2df0dcad 100644 --- a/packages/sol-resolver/src/resolvers/npm_resolver.ts +++ b/packages/sol-resolver/src/resolvers/npm_resolver.ts @@ -19,7 +19,7 @@ export class NPMResolver extends Resolver { const ROOT_PATH = '/'; while (currentPath !== ROOT_PATH) { const lookupPath = path.join(currentPath, 'node_modules', packageName, pathWithinPackage); - if (fs.existsSync(lookupPath)) { + if (fs.existsSync(lookupPath) && fs.lstatSync(lookupPath).isFile()) { const fileContent = fs.readFileSync(lookupPath).toString(); return { source: fileContent, 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, |