Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix contracts-gen copy #19

Merged
merged 1 commit into from
Jan 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions contracts-gen/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
[
{
"version": "2.0.28",
"changes": [
{
"note": "Remove .sol extension when running contracts-gen copy on individual files",
"pr": 19
}
]
},
{
"timestamp": 1610044030,
"version": "2.0.27",
Expand Down
8 changes: 5 additions & 3 deletions contracts-gen/src/contracts-gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,16 @@ function copyOverTestArtifactsAndWrappersToSrc(
): void {
// Copy over artifacts
srcContracts.forEach(contract => {
const srcPath = `${srcArtifactsDir}/${contract}.json`;
const contractName = path.basename(contract, SOLIDITY_EXTENSION);
const srcPath = `${srcArtifactsDir}/${contractName}.json`;
mkdirp.sync(srcArtifactsDir);
fs.copyFileSync(`${testArtifactsDir}/${contract}.json`, srcPath);
fs.copyFileSync(`${testArtifactsDir}/${contractName}.json`, srcPath);
});

// Copy over wrappers
srcContracts.forEach(contract => {
const wrapperFileName = makeOutputFileName(contract);
const contractName = path.basename(contract, SOLIDITY_EXTENSION);
const wrapperFileName = makeOutputFileName(contractName);
const srcPath = `${srcWrappersDir}/${wrapperFileName}.ts`;
mkdirp.sync(srcWrappersDir);
fs.copyFileSync(`${testWrappersDir}/${wrapperFileName}.ts`, srcPath);
Expand Down