From 5c056b57b7c16c2c7a27143dcfd1e7a340a191a9 Mon Sep 17 00:00:00 2001 From: "F. Eugene Aumson" Date: Wed, 22 Aug 2018 17:47:40 -0400 Subject: extract method _getContractNamesToCompile() --- packages/sol-compiler/src/compiler.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'packages') diff --git a/packages/sol-compiler/src/compiler.ts b/packages/sol-compiler/src/compiler.ts index c44585a36..bc6243a8f 100644 --- a/packages/sol-compiler/src/compiler.ts +++ b/packages/sol-compiler/src/compiler.ts @@ -159,16 +159,17 @@ export class Compiler { public async compileAsync(): Promise { await createDirIfDoesNotExistAsync(this._artifactsDir); await createDirIfDoesNotExistAsync(SOLC_BIN_DIR); - let contractNamesToCompile: string[] = []; + await this._compileContractsAsync(this._getContractNamesToCompile()); + } + private _getContractNamesToCompile(): string[] { if (this._specifiedContracts === ALL_CONTRACTS_IDENTIFIER) { const allContracts = this._nameResolver.getAll(); - contractNamesToCompile = _.map(allContracts, contractSource => + return _.map(allContracts, contractSource => path.basename(contractSource.path, constants.SOLIDITY_FILE_EXTENSION), ); } else { - contractNamesToCompile = this._specifiedContracts; + return this._specifiedContracts; } - await this._compileContractsAsync(contractNamesToCompile); } /** * Compiles contract and saves artifact to artifactsDir. -- cgit v1.2.3