Fix contracts-gen so make sure all dirs are created
This commit is contained in:
parent
5db1820123
commit
bc1dca3f6f
@ -54,6 +54,13 @@ const COPY = 'copy';
|
|||||||
const srcArtifactsDir = convertToTopLevelDir('testArtifactsDir', testArtifactsDir);
|
const srcArtifactsDir = convertToTopLevelDir('testArtifactsDir', testArtifactsDir);
|
||||||
const testWrappersDir = DEFAULT_WRAPPERS_DIR;
|
const testWrappersDir = DEFAULT_WRAPPERS_DIR;
|
||||||
const srcWrappersDir = convertToTopLevelDir('testWrappersDir', testWrappersDir);
|
const srcWrappersDir = convertToTopLevelDir('testWrappersDir', testWrappersDir);
|
||||||
|
|
||||||
|
// Make sure all dirs exist, if not, create them
|
||||||
|
mkdirp.sync(testArtifactsDir);
|
||||||
|
mkdirp.sync(srcArtifactsDir);
|
||||||
|
mkdirp.sync(testWrappersDir);
|
||||||
|
mkdirp.sync(srcWrappersDir);
|
||||||
|
|
||||||
if (command === GENERATE) {
|
if (command === GENERATE) {
|
||||||
await regenerateContractPackageAsync(
|
await regenerateContractPackageAsync(
|
||||||
testContracts,
|
testContracts,
|
||||||
@ -197,7 +204,6 @@ function generateArtifactsTs(
|
|||||||
export const artifacts = {${artifacts.join('\n')}};
|
export const artifacts = {${artifacts.join('\n')}};
|
||||||
`;
|
`;
|
||||||
const formattedArtifactsTs = prettier.format(artifactsTs, { ...prettierConfig, filepath: artifactsTsFilePath });
|
const formattedArtifactsTs = prettier.format(artifactsTs, { ...prettierConfig, filepath: artifactsTsFilePath });
|
||||||
mkdirp.sync(artifactsTsFilePath);
|
|
||||||
fs.writeFileSync(artifactsTsFilePath, formattedArtifactsTs);
|
fs.writeFileSync(artifactsTsFilePath, formattedArtifactsTs);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -219,7 +225,6 @@ function generateWrappersTs(
|
|||||||
${sortedImports.join('\n')}
|
${sortedImports.join('\n')}
|
||||||
`;
|
`;
|
||||||
const formattedArtifactsTs = prettier.format(wrappersTs, { ...prettierConfig, filepath: wrappersTsFilePath });
|
const formattedArtifactsTs = prettier.format(wrappersTs, { ...prettierConfig, filepath: wrappersTsFilePath });
|
||||||
mkdirp.sync(wrappersTsFilePath);
|
|
||||||
fs.writeFileSync(wrappersTsFilePath, formattedArtifactsTs);
|
fs.writeFileSync(wrappersTsFilePath, formattedArtifactsTs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user