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

Do not fail if contracts folder is missing #1107

Merged
merged 1 commit into from
Jul 17, 2019
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
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