Skip to content

Commit

Permalink
support custom root path in hardhat config
Browse files Browse the repository at this point in the history
  • Loading branch information
frangio committed Jun 15, 2023
1 parent 885c2ba commit 0de23e8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 0.3.8

- Support custom `paths.root` in Hardhat config.

## 0.3.7

- Use a constant variable for the bytecode marker.
Expand Down
3 changes: 2 additions & 1 deletion src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ export function getExposed(

function getExposedFile(rootPath: string, absolutePath: string, ast: SourceUnit, deref: ASTDereferencer, initializers?: boolean, prefix?: string): ResolvedFile {
const sourceName = path.relative(rootPath, absolutePath);
const dirname = path.dirname(absolutePath);

const relativizePath = (p: string) => path.relative(path.dirname(absolutePath), p).replace(/\\/g, '/');
const relativizePath = (p: string) => path.relative(dirname, path.join(rootPath, p)).replace(/\\/g, '/');
const content = getExposedContent(ast, relativizePath, deref, initializers, prefix);
const contentHash = createNonCryptographicHashBasedIdentifier(Buffer.from(content.rawContent)).toString('hex');

Expand Down

0 comments on commit 0de23e8

Please sign in to comment.