aboutsummaryrefslogtreecommitdiffstats
path: root/packages/sol-resolver/src/resolvers/fs_resolver.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/sol-resolver/src/resolvers/fs_resolver.ts')
-rw-r--r--packages/sol-resolver/src/resolvers/fs_resolver.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/packages/sol-resolver/src/resolvers/fs_resolver.ts b/packages/sol-resolver/src/resolvers/fs_resolver.ts
index 86128023d..248fa405e 100644
--- a/packages/sol-resolver/src/resolvers/fs_resolver.ts
+++ b/packages/sol-resolver/src/resolvers/fs_resolver.ts
@@ -1,4 +1,5 @@
import * as fs from 'fs';
+import * as path from 'path';
import { ContractSource } from '../types';
@@ -9,7 +10,8 @@ export class FSResolver extends Resolver {
public resolveIfExists(importPath: string): ContractSource | undefined {
if (fs.existsSync(importPath) && fs.lstatSync(importPath).isFile()) {
const fileContent = fs.readFileSync(importPath).toString();
- return { source: fileContent, path: importPath, absolutePath: importPath };
+ const absolutePath = path.resolve(importPath);
+ return { source: fileContent, path: importPath, absolutePath } as any;
}
return undefined;
}