aboutsummaryrefslogtreecommitdiffstats
path: root/packages/sol-resolver/src/resolvers/relative_fs_resolver.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/sol-resolver/src/resolvers/relative_fs_resolver.ts')
-rw-r--r--packages/sol-resolver/src/resolvers/relative_fs_resolver.ts7
1 files changed, 2 insertions, 5 deletions
diff --git a/packages/sol-resolver/src/resolvers/relative_fs_resolver.ts b/packages/sol-resolver/src/resolvers/relative_fs_resolver.ts
index ed96040d3..cfff145f9 100644
--- a/packages/sol-resolver/src/resolvers/relative_fs_resolver.ts
+++ b/packages/sol-resolver/src/resolvers/relative_fs_resolver.ts
@@ -13,13 +13,10 @@ 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);
+ const filePath = path.resolve(path.join(this._contractsDir, importPath));
if (fs.existsSync(filePath) && !fs.lstatSync(filePath).isDirectory()) {
const fileContent = fs.readFileSync(filePath).toString();
- return {
- source: fileContent,
- path: importPath,
- };
+ return { source: fileContent, path: importPath, absolutePath: filePath };
}
return undefined;
}