Skip to content
This repository has been archived by the owner on Jan 24, 2022. It is now read-only.

Commit

Permalink
Do not fail if contracts folder is missing (#1107)
Browse files Browse the repository at this point in the history
Fixes #1068
  • Loading branch information
spalladino authored and jbcarpanelli committed Jul 17, 2019
1 parent 63c1535 commit 91be4de
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ class SolidityProjectCompiler {
}

private _loadSoliditySourcesFromDir(dir = this.inputDir): void {
if (!existsSync(dir) || !lstatSync(dir).isDirectory) return;

// TODO: Replace by a glob expression
readdirSync(dir).forEach(fileName => {
const filePath = path.resolve(dir, fileName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,11 @@ describe('SolidityProjectCompiler', function() {
it('compiles without errors', async function() {
await compileProject({ inputDir, outputDir, version: '0.5.9' });
});

it('compiles without errors if input dir does not exist', async function() {
const inputDir = `${rootDir}/test/mocks/mock-stdlib-empty/not-exists`;
await compileProject({ inputDir, outputDir, version: '0.5.9' });
});
});

describe('in mock-project-with-root-imports project', function() {
Expand Down

0 comments on commit 91be4de

Please sign in to comment.